#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
const int SQ = 320;
long long toadd[N], added[N], uni[SQ][N], a[N], b[N], sum[N];
vector<int> ver[N], st[N], bst;
int sz[N];
inline int in() {
  int x;
  scanf("%d", &x);
  return x;
}
int main() {
  int n, m, q;
  n = in(), m = in(), q = in();
  for (int i = 0; i < n; i++) a[i] = in();
  for (int i = 0; i < m; i++) {
    sz[i] = in();
    if (sz[i] >= SQ) bst.push_back(i);
    for (int j = 0; j < sz[i]; j++) {
      int c = in() - 1;
      sum[i] += a[c];
      st[i].push_back(c);
      ver[c].push_back(i);
    }
  }
  for (int i = 0; i < bst.size(); i++) {
    for (auto j : st[bst[i]]) {
      for (auto k : ver[j]) {
        uni[i][k]++;
      }
    }
  }
  while (q--) {
    char ch;
    int k, x;
    long long ans = 0;
    scanf(" %c%d", &ch, &k);
    k--;
    if (ch == '?') {
      if (sz[k] < SQ) {
        for (auto i : st[k]) ans += b[i];
      }
      for (int i = 0; i < bst.size(); i++) ans += added[bst[i]] * uni[i][k];
      printf("%lld ", ans + toadd[k] + sum[k]);
    } else {
      x = in();
      if (sz[k] < SQ) {
        for (auto i : st[k]) b[i] += x;
        for (int i = 0; i < bst.size(); i++) toadd[bst[i]] += x * uni[i][k];
      }
      added[k] += x;
    }
  }
}
