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