#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void umax(T &a, T b) {
  if (a < b) a = b;
}
const int maxn = 100000 + 2;
const int INF = 1e9 + 7;
int sq = 0;
int n, m, q, x;
long long a[maxn], y;
vector<long long> sets[maxn];
vector<int> hvy;
int dp[340][maxn];
bool chk[maxn];
bool isHeavy[maxn];
long long val_heavy[maxn];
long long cr7[maxn], lm10[maxn];
long long query(int set_num) {
  long long ret = 0;
  if (!isHeavy[set_num]) {
    for (int i = (0); i < (sets[set_num].size()); i++)
      ret += a[sets[set_num][i]];
    for (int i = (0); i < (hvy.size()); i++) {
      ret += lm10[hvy[i]] * dp[i][set_num];
    }
    return ret;
  }
  ret = val_heavy[set_num] + cr7[set_num];
  for (int i = (0); i < (hvy.size()); i++) {
    int m = hvy[i];
    ret += dp[i][set_num] * lm10[m];
  }
  return ret;
}
void upd(int set_num, long long y) {
  if (!isHeavy[set_num]) {
    for (int i = (0); i < (sets[set_num].size()); i++) a[sets[set_num][i]] += y;
    for (int i = (0); i < (hvy.size()); i++) {
      cr7[hvy[i]] += y * dp[i][set_num];
    }
    return;
  }
  lm10[set_num] += y;
  return;
}
inline void solve(void) {
  cin >> n >> m >> q;
  sq = (int)sqrt(n);
  for (int i = (1); i < (n + 1); i++) cin >> a[i];
  for (int i = (1); i < (m + 1); i++) {
    cin >> x;
    long long v = 0;
    for (int j = (0); j < (x); j++) {
      cin >> y;
      v += a[y];
      sets[i].push_back(y);
    }
    if (sets[i].size() > sq) {
      hvy.push_back(i);
      isHeavy[i] = true;
      val_heavy[i] = v;
    }
  }
  for (int i = (0); i < (hvy.size()); i++) {
    for (int j = (0); j < (sets[hvy[i]].size()); j++)
      chk[sets[hvy[i]][j]] = true;
    for (int k = (1); k < (m + 1); k++) {
      int c = 0;
      for (int j = (0); j < (sets[k].size()); j++) {
        int x = sets[k][j];
        if (chk[x] == true) c++;
      }
      dp[i][k] = c;
    }
    for (int j = (0); j < (sets[hvy[i]].size()); j++)
      chk[sets[hvy[i]][j]] = false;
  }
  char inp;
  while (q--) {
    cin >> inp;
    if (inp == '?') {
      cin >> x;
      cout << query(x) << endl;
    } else {
      cin >> x >> y;
      upd(x, y);
    }
  }
  return;
}
void init() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
}
int main(int argc, const char *argv[]) {
  init();
  solve();
  return 0;
}
