#include <bits/stdc++.h>
using namespace std;
int is_big[100010], big[360];
long long delta[360], res[360];
int same[360][100010];
int sz[100010], cnt[100010];
long long arr[100010];
vector<int> num[100010];
int main() {
  int n, m, q, tot = 0;
  memset(is_big, -1, sizeof(is_big));
  scanf("%d%d%d", &n, &m, &q);
  int limit = ceil(sqrt(n));
  for (int i = 0; i < n; i++) scanf("%lld", arr + i);
  for (int i = 0; i < m; i++) {
    scanf("%d", sz + i);
    for (int j = 0; j < sz[i]; j++) {
      int x;
      scanf("%d", &x);
      num[i].push_back(--x);
    }
    if (sz[i] > limit) {
      is_big[i] = tot;
      big[tot] = i;
      tot++;
    }
  }
  for (int i = 0; i < tot; i++) {
    for (int j = 0; j < sz[big[i]]; j++) {
      res[i] += arr[num[big[i]][j]];
      cnt[num[big[i]][j]]++;
    }
    for (int j = 0; j < m; j++) {
      for (int k = 0; k < sz[j]; k++) same[i][j] += cnt[num[j][k]];
    }
    for (int j = 0; j < sz[big[i]]; j++) cnt[num[big[i]][j]]--;
  }
  for (int i = 0; i < tot; i++) cnt[big[i]] = i;
  while (q--) {
    char tp;
    scanf("\n%c", &tp);
    if (tp == '?') {
      int x;
      scanf("%d", &x);
      x--;
      if (is_big[x] == -1) {
        long long ans = 0;
        for (int i = 0; i < sz[x]; i++) ans += arr[num[x][i]];
        for (int i = 0; i < tot; i++) ans += (long long)same[i][x] * delta[i];
        printf("%lld\n", ans);
      } else {
        long long ans = res[cnt[x]];
        for (int i = 0; i < tot; i++) ans += (long long)same[i][x] * delta[i];
        printf("%lld\n", ans);
      }
    } else {
      int x, y;
      scanf("%d%d", &x, &y);
      x--;
      if (is_big[x] == -1) {
        for (int i = 0; i < sz[x]; i++) arr[num[x][i]] += y;
        for (int i = 0; i < tot; i++) res[i] += (long long)same[i][x] * y;
      } else
        delta[cnt[x]] += y;
    }
  }
  return 0;
}
