#include <bits/stdc++.h>
using namespace std;
const int MX = 1e5 + 5;
const int mod = 1e9 + 7;
int n, m, q, wsz;
vector<int> A[MX];
int st1[MX], st[MX], ssz;
long long sum[MX], col[MX], S[MX], w[MX], pre[MX];
bool vis[320][MX];
int G[MX][320];
void presolve() {
  for (int i = 1; i <= m; i++) {
    int sz = A[i].size();
    for (int j = 0; j < sz; j++) {
      pre[i] += S[A[i][j]];
    }
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &S[i]);
  }
  wsz = sqrt(n + 0.5);
  for (int i = 1; i <= m; i++) {
    int tot;
    scanf("%d", &tot);
    for (int j = 1; j <= tot; j++) {
      int t;
      scanf("%d", &t);
      A[i].push_back(t);
    }
    if (tot <= wsz)
      st[i] = 0;
    else {
      st[i] = 1, st1[++ssz] = i;
      for (int j = 0; j < tot; j++) {
        vis[ssz][A[i][j]] = 1;
      }
    }
  }
  presolve();
  for (int i = 1; i <= m; i++) {
    int sz = A[i].size();
    for (int j = 0; j < sz; j++) {
      int num = A[i][j];
      for (int k = 1; k <= ssz; k++) {
        if (vis[k][num]) G[i][k]++;
      }
    }
  }
  for (int i = 1; i <= q; i++) {
    char op[10];
    int a, b, sz;
    scanf("%s%d", op, &a);
    sz = A[a].size();
    if (op[0] == '?') {
      long long ans = pre[a];
      if (st[a] == 0) {
        for (int j = 0; j < sz; j++) {
          ans += sum[A[a][j]];
        }
        for (int j = 1; j <= ssz; j++) {
          ans += (long long)G[a][j] * col[st1[j]];
        }
      } else
        ans += w[a];
      printf("%I64d\n", ans);
    } else {
      scanf("%d", &b);
      if (st[a] == 0) {
        for (int j = 0; j < sz; j++) {
          sum[A[a][j]] += b;
        }
      } else
        col[a] += b;
      for (int j = 1; j <= ssz; j++) {
        w[st1[j]] += (long long)G[a][j] * b;
      }
    }
  }
  return 0;
}
