#include <bits/stdc++.h>
const int N = 1e5 + 5;
const int magic = 300;
using namespace std;
vector<int> mv[N];
int n, m, q, cnt[N], id[N], nblock, add[N / magic + 5][N];
long long a[N], sum[N], offset[N];
bool ck[N / magic + 5][N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> q;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= m; i++) {
    cin >> cnt[i];
    for (int j = 1; j <= cnt[i]; j++) {
      int x;
      cin >> x;
      mv[i].push_back(x);
      if (cnt[i] > magic) sum[nblock] += a[x], ck[nblock][x] = true;
    }
    if (cnt[i] > magic) id[i] = nblock++;
  }
  for (int i = 1; i <= m; i++) {
    for (auto x : mv[i])
      for (int j = 0; j < nblock; j++) add[j][i] += ck[j][x];
  }
  while (q--) {
    char c;
    int k, val;
    cin >> c >> k;
    if (c == '?') {
      long long ans = 0;
      for (int i = 0; i < nblock; i++) ans += add[i][k] * offset[i];
      if (cnt[k] > magic)
        ans += sum[id[k]];
      else {
        for (auto x : mv[k]) ans += a[x];
      }
      cout << ans << "\n";
    } else {
      cin >> val;
      if (cnt[k] > magic)
        offset[id[k]] += val;
      else {
        for (auto x : mv[k]) a[x] += val;
        for (int i = 0; i < nblock; i++) sum[i] += 1LL * add[i][k] * val;
      }
    }
  }
}
