#include <bits/stdc++.h>
using namespace std;
long long a[100005], sum[100005], add[100005];
vector<int> v[100005], bigset[100005], intersec[100005];
int id_heavy[100005], sz_set[100005];
void input() {
  int n, ns, nq;
  int i, j, x, y, sz;
  char s[100];
  long long val;
  scanf("%d %d %d", &n, &ns, &nq);
  for ((i) = (1); (i) <= (n); (i)++) scanf("%I64d", &a[i]);
  int Block = (int)sqrt(n);
  int cntbig = 0;
  for ((i) = (1); (i) <= (ns); (i)++) {
    scanf("%d", &sz);
    sz_set[i] = sz;
    if (sz <= Block) {
      for ((j) = 0; (j) < (sz); (j)++) scanf("%d", &x), v[i].push_back(x);
    } else {
      id_heavy[i] = cntbig;
      for ((j) = 0; (j) < (sz); (j)++)
        scanf("%d", &x), v[i].push_back(x), bigset[x].push_back(cntbig),
            sum[cntbig] += a[x];
      cntbig++;
    }
  }
  for ((i) = (1); (i) <= (ns); (i)++) {
    intersec[i].resize(cntbig, 0);
    for (typeof(v[i].begin()) ite = v[i].begin(); ite != v[i].end(); ite++) {
      x = *ite;
      for (typeof(bigset[x].begin()) jte = bigset[x].begin();
           jte != bigset[x].end(); jte++)
        intersec[i][*jte]++;
    }
  }
  while (nq--) {
    scanf("%s %d", &s, &x);
    if (s[0] == '?') {
      long long res = 0;
      if (sz_set[x] <= Block) {
        for (typeof(v[x].begin()) ite = v[x].begin(); ite != v[x].end(); ite++)
          res += a[*ite];
        for ((i) = 0; (i) < (cntbig); (i)++)
          res += add[i] * (long long)intersec[x][i];
      } else {
        res = sum[id_heavy[x]];
        for ((i) = 0; (i) < (cntbig); (i)++)
          res += add[i] * (long long)intersec[x][i];
      }
      printf("%I64d\n", res);
    } else {
      scanf("%I64d", &val);
      if (sz_set[x] <= Block) {
        for (typeof(v[x].begin()) ite = v[x].begin(); ite != v[x].end(); ite++)
          a[*ite] += val;
        for ((i) = 0; (i) < (cntbig); (i)++)
          sum[i] += (long long)intersec[x][i] * val;
      } else
        add[id_heavy[x]] += val;
    }
  }
}
int main() {
  input();
  return 0;
}
