#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, SN = 350;
int sz[N], vbig[N][SN], in = 1, big[N];
long long a[N], small[N], sum[N];
vector<int> v[N], cnt[N], bigs;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) {
    cin >> sz[i];
    if (sz[i] > SN) {
      big[i] = in++;
      bigs.push_back(i);
    }
    for (int j = 0; j < sz[i]; j++) {
      int x;
      cin >> x;
      x--;
      cnt[x].push_back(i);
      v[i].push_back(x);
      sum[i] += a[x];
    }
  }
  for (int i = 0; i < n; i++)
    for (int x : cnt[i])
      if (big[x])
        for (int y : cnt[i])
          if (x != y) vbig[y][big[x] - 1]++;
  while (q--) {
    char c;
    int k;
    cin >> c >> k;
    k--;
    if (c == '?') {
      if (big[k])
        cout << sum[k] << ' ';
      else {
        long long ans = 0;
        for (int x : v[k]) ans += a[x];
        for (int i = 0; i < bigs.size(); i++)
          ans += small[bigs[i]] * vbig[k][i];
        cout << ans << ' ';
      }
    } else {
      int x;
      cin >> x;
      for (int i = 0; i < bigs.size(); i++)
        sum[bigs[i]] += (long long)vbig[k][i] * x;
      if (big[k]) {
        sum[k] += 1ll * sz[k] * x;
        small[k] += x;
      } else
        for (int y : v[k]) a[y] += x;
    }
  }
  cin >> n;
  return 0;
}
