#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T bpow(T p, T e) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p);
    p = (p * p);
  }
  return (T)ret;
}
int toInt(string s) {
  int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
int toLlint(string s) {
  long long int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
int ts, kk = 1;
vector<int> v[100002];
long long int a[100002];
int sz[100002];
int n, m, blk;
int id[100002];
bitset<100002> on[320], q;
int cm[320][320];
int cmt[320][100002];
long long int hva[320], qv[320];
int hv;
int main() {
  int t, i, j, k;
  scanf("%d%d%d", &n, &m, &ts);
  for (blk = 1; blk * blk <= n; blk++)
    ;
  for (i = 1; i < n + 1; i++) {
    scanf("%I64d", &a[i]);
  }
  hv = 0;
  for (i = 1; i < m + 1; i++) {
    scanf("%d", &sz[i]);
    if (sz[i] <= blk) {
      id[i] = 0;
    } else {
      hv++;
      id[i] = hv;
      on[hv].reset();
      hva[hv] = qv[hv] = 0;
    }
    for (j = 0; j < sz[i]; j++) {
      scanf("%d", &k);
      if (id[i]) {
        on[hv][k] = 1;
        hva[hv] += a[k];
      } else
        v[i].push_back(k);
    }
    if (id[i]) {
      for (j = 1; j < hv; j++) {
        q = (on[j] & on[hv]);
        cm[j][hv] = cm[hv][j] = q.count();
      }
    }
  }
  for (i = 1; i <= m; i++)
    if (id[i]) {
      t = id[i];
      for (j = 1; j < m + 1; j++)
        if (id[j] == 0)
          for (k = 0; k < sz[j]; k++) {
            if (on[t][v[j][k]]) cmt[t][j]++;
          }
    }
  while (ts--) {
    char ch;
    scanf(" %c %d", &ch, &k);
    if (ch == '+') {
      int x;
      scanf("%d", &x);
      if (id[k] == 0) {
        for (i = 0; i < sz[k]; i++) {
          a[v[k][i]] += x;
        }
        for (j = hv; j > 0; j--) {
          hva[j] += (long long int)x * cmt[j][k];
        }
      } else {
        t = id[k];
        qv[t] += x;
        for (j = hv; j > 0; j--) {
          if (j != t) {
            hva[j] += (long long int)x * (long long int)cm[j][t];
          }
        }
      }
    } else {
      long long int rs = 0;
      if (id[k] == 0) {
        for (i = 0; i < v[k].size(); i++) {
          int u = v[k][i];
          rs += a[u];
        }
        for (j = hv; j > 0; j--) {
          rs += qv[j] * (long long int)cmt[j][k];
        }
      } else {
        t = id[k];
        rs += qv[t] * (long long int)sz[k] + hva[t];
      }
      printf("%I64d\n", rs);
    }
  }
  return 0;
}
