#include <bits/stdc++.h>
using namespace std;
vector<int> st[100000 + 10];
long long ar[100000 + 10], add[100000 + 10], pre[100000 + 10];
int match[100000 + 10][333];
int heavy[333];
bool hvy[100000 + 10], chk[100000 + 10][333];
int main() {
  int n, m, q;
  scanf("%d %d %d", &n, &m, &q);
  for (int i = 1; i <= n; i++) scanf("%I64d", &ar[i]);
  int l = 0, h = 0;
  for (int i = 1; i <= m; i++) {
    int k;
    scanf("%d", &k);
    for (int j = 0; j < k; j++) {
      int a;
      scanf("%d", &a);
      st[i].push_back(a);
      pre[i] += ar[a];
    }
    if (k >= 320) {
      hvy[i] = true;
      heavy[h++] = i;
    }
  }
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < st[heavy[i]].size(); j++)
      chk[st[heavy[i]][j]][i] = true;
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j < st[i].size(); j++) {
      for (int k = 0; k < h; k++)
        if (chk[st[i][j]][k]) match[i][k]++;
    }
  }
  for (int i = 0; i < q; i++) {
    char op[3];
    scanf("%s", op);
    if (op[0] == '?') {
      int a;
      scanf("%d", &a);
      long long ans = 0ll;
      if (hvy[a])
        ans = pre[a];
      else
        for (int j = 0; j < st[a].size(); j++) ans += ar[st[a][j]];
      for (int j = 0; j < h; j++) ans += add[heavy[j]] * (long long)match[a][j];
      printf("%I64d\n", ans);
    } else {
      int a;
      long long b;
      scanf("%d %I64d", &a, &b);
      if (hvy[a])
        add[a] += b;
      else {
        pre[a] = 0;
        for (int j = 0; j < st[a].size(); j++) {
          ar[st[a][j]] += b;
          pre[a] += ar[st[a][j]];
        }
        for (int j = 0; j < h; j++) pre[heavy[j]] += (long long)match[a][j] * b;
      }
    }
  }
  return 0;
}
