#include <bits/stdc++.h>
inline int Input() {
  int ret = 0;
  bool isN = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') isN = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    ret = ret * 10 + c - '0';
    c = getchar();
  }
  return isN ? -ret : ret;
}
inline void Output(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  int len = 0, data[20];
  while (x) {
    data[len++] = x % 10;
    x /= 10;
  }
  if (!len) data[len++] = 0;
  while (len--) putchar(data[len] + 48);
  putchar('\n');
}
#pragma comment(linker, "/STACK:124000000,124000000")
using namespace std;
const int B = 350;
long long add[B], sum[B];
int cnt[100105][B];
long long tot[100105];
bool h[100105];
int id[100105];
vector<int> g[100105];
vector<int> f[100105];
int main() {
  int n, m, q, k;
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &tot[i]);
  }
  k = 0;
  for (int i = 1, v, s; i <= m; i++) {
    scanf("%d", &s);
    if (s > B) {
      id[i] = k++;
      h[i] = 1;
    } else
      h[i] = 0;
    for (int j = 1; j <= s; j++) {
      scanf("%d", &v);
      f[i].push_back(v);
      if (h[i]) {
        g[v].push_back(k - 1);
        sum[k - 1] += tot[v];
      }
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 0, v; j < f[i].size(); j++) {
      v = f[i][j];
      for (int x = 0; x < g[v].size(); x++) cnt[i][g[v][x]]++;
    }
  }
  while (q--) {
    char op[4];
    scanf("%s", op);
    if (op[0] == '?') {
      int num;
      scanf("%d", &num);
      long long ans = 0;
      if (h[num]) {
        ans += sum[id[num]];
        for (int i = 0; i < k; i++) {
          ans += cnt[num][i] * add[i];
        }
      } else {
        for (int i = 0; i < f[num].size(); i++) ans += tot[f[num][i]];
        for (int i = 0; i < k; i++) {
          ans += cnt[num][i] * add[i];
        }
      }
      printf("%I64d\n", ans);
    } else {
      int num;
      long long v;
      scanf("%d%I64d", &num, &v);
      if (h[num]) {
        add[id[num]] += v;
      } else {
        for (int i = 0; i < f[num].size(); i++) tot[f[num][i]] += v;
        for (int i = 0; i < k; i++) {
          sum[i] += v * cnt[num][i];
        }
      }
    }
  }
  return 0;
}
