#include <bits/stdc++.h>
using namespace std;
template <typename __>
inline void read(__ &s) {
  s = 0;
  __ f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  s *= f;
}
struct heavy {
  int siz, l, r;
} QWQ[100001];
int n, m, q;
int id[100001], tmp[100001], rem[360], cnt[360][100001];
long long a[100001], flag[360], sum[360];
void update(int x, int w) {
  for (int i = QWQ[x].l; i <= QWQ[x].r; i++) a[id[i]] += w;
  for (int i = 1; i <= rem[0]; i++) sum[i] += 1LL * cnt[i][x] * w;
}
long long queryheavy(int x) {
  int pos = tmp[x];
  long long ans = sum[pos];
  for (int i = 1; i <= rem[0]; i++) ans += 1LL * cnt[i][x] * flag[i];
  return ans;
}
long long querylight(int x) {
  long long ans = 0;
  for (int i = QWQ[x].l; i <= QWQ[x].r; i++) ans += a[id[i]];
  for (int i = 1; i <= rem[0]; i++) ans += 1LL * cnt[i][x] * flag[i];
  return ans;
}
int main() {
  read(n);
  read(m);
  read(q);
  int lim = ceil(sqrt(n)), i, j, k, x, w, now;
  for (i = 1; i <= n; i++) read(a[i]);
  for (i = 1; i <= m; i++) {
    read(QWQ[i].siz);
    QWQ[i].l = id[0] + 1;
    for (j = 1; j <= QWQ[i].siz; j++) read(id[++id[0]]);
    QWQ[i].r = id[0];
    if (QWQ[i].siz > lim) rem[++rem[0]] = i;
  }
  for (i = 1; i <= rem[0]; i++) {
    now = rem[i];
    for (j = QWQ[now].l; j <= QWQ[now].r; j++) {
      ++tmp[id[j]];
      sum[i] += a[id[j]];
    }
    for (j = 1; j <= m; j++)
      for (k = QWQ[j].l; k <= QWQ[j].r; k++) cnt[i][j] += tmp[id[k]];
    for (j = QWQ[now].l; j <= QWQ[now].r; j++) --tmp[id[j]];
  }
  for (i = 1; i <= rem[0]; i++) tmp[rem[i]] = i;
  char s;
  for (int i = 1; i <= q; i++) {
    s = getchar();
    while (s != '?' && s != '+') s = getchar();
    if (s == '?') {
      read(x);
      if (QWQ[x].siz > lim) {
        printf("%lld\n", queryheavy(x));
        continue;
      }
      printf("%lld\n", querylight(x));
    } else {
      read(x);
      read(w);
      if (QWQ[x].siz > lim)
        flag[tmp[x]] += w;
      else
        update(x, w);
    }
  }
}
