#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
vector<int> tohao[maxn];
vector<int> shui[maxn];
vector<int> dav[maxn];
vector<int> guan[maxn];
int first[maxn], nxt[10100000], vv[10100000], w[10100000];
int d[maxn], dd[maxn];
int a[5000010];
long long val[maxn], haha[maxn], lz[maxn];
int main() {
  int n, m, q, i, j, k, t;
  cin >> n >> m >> q;
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (i = 1; i <= m; i++) {
    scanf("%d", &k);
    for (j = 1; j <= k; j++) {
      scanf("%d", &t);
      shui[t].push_back(i);
      val[i] += a[t];
    }
  }
  for (i = 1; i <= n; i++)
    if (shui[i].size() > 100) {
      for (j = 0; j < shui[i].size(); j++) tohao[shui[i][j]].push_back(i);
    } else {
      for (j = 0; j < shui[i].size(); j++)
        dav[shui[i][j]].push_back(i), dd[shui[i][j]]++;
    }
  int cnt = 0;
  int u, v, e = 2;
  for (i = 1; i <= m; i++) {
    cnt = 0;
    for (j = 0; j < dav[i].size(); j++) {
      t = dav[i][j];
      for (k = 0; k < shui[t].size(); k++)
        if (shui[t][k] > i) a[++cnt] = shui[t][k];
    }
    sort(a + 1, a + 1 + cnt);
    for (j = 1; j <= cnt; j++)
      if (j == 1 || a[j] - a[j - 1]) {
        for (k = j; k <= cnt && a[k] == a[j]; k++)
          ;
        u = i, v = a[j];
        nxt[e] = first[u], vv[e] = v, w[e] = k - j, first[u] = e++;
        nxt[e] = first[v], vv[e] = u, w[e] = k - j, first[v] = e++;
        j = k - 1;
        d[u]++, d[v]++;
      }
  }
  for (i = 1; i <= m; i++) dav[i].clear();
  for (i = 1; i <= m; i++) {
    for (e = first[i]; e; e = nxt[e]) {
      v = vv[e];
      if (d[v] > 300) dav[i].push_back(v), guan[i].push_back(w[e]);
    }
  }
  int x;
  char str[20];
  while (q--) {
    scanf("%s", str);
    if (str[0] == '?') {
      scanf("%d", &k);
      long long ans = val[k];
      for (i = 0; i < tohao[k].size(); i++) ans += haha[tohao[k][i]];
      for (i = 0; i < dav[k].size(); i++) ans += lz[dav[k][i]] * guan[k][i];
      printf("%I64d\n", ans);
    } else {
      scanf("%d%d", &k, &x);
      for (i = 0; i < tohao[k].size(); i++) haha[tohao[k][i]] += x;
      val[k] += dd[k] * (x + 0ll);
      if (d[k] > 300) {
        lz[k] += x;
      } else {
        for (e = first[k]; e; e = nxt[e]) {
          v = vv[e];
          val[v] += (x + 0ll) * w[e];
        }
      }
    }
  }
}
