#include <bits/stdc++.h>
using namespace std;
long long n, m, q;
long long A[100011];
long long sum[100011];
long long cnt[100011];
vector<long long> sets[100011];
vector<long long> inSet[100011];
long long bigNum[100011];
long long bigSet[100011];
long long numBag[100011];
long long setBag[100011];
vector<long long> adjBigNum[100011];
vector<pair<long long, long long> > adjBigSet[100011];
map<long long, long long> adj[100011];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> q;
  for (long long i = 0; i < n; i++) cin >> A[i];
  for (long long i = 0; i < m; i++) {
    long long k;
    cin >> k;
    for (long long j = 0; j < k; j++) {
      long long x;
      cin >> x;
      x--;
      sets[i].push_back(x);
      inSet[x].push_back(i);
      sum[i] += A[x];
      cnt[i]++;
    }
    if (k >= 320) bigSet[i] = true;
  }
  for (long long i = 0; i < n; i++)
    if (cnt[i] >= 320) bigNum[i] = true;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < (long long)inSet[i].size(); j++) {
      long long u = inSet[i][j];
      if (!bigSet[u]) continue;
      for (long long k = 0; k < (long long)inSet[i].size(); k++) {
        long long v = inSet[i][k];
        adj[v][u]++;
      }
    }
  }
  for (long long i = 0; i < m; i++) {
    for (long long x : sets[i])
      if (bigNum[x]) adjBigNum[i].push_back(x);
    for (auto x : adj[i]) adjBigSet[i].emplace_back(x);
  }
  while (q--) {
    char typ;
    cin >> typ;
    if (typ == '?') {
      long long k;
      cin >> k;
      k--;
      long long res = sum[k];
      for (long long x : adjBigNum[k]) res += numBag[x];
      for (auto x : adjBigSet[k]) res += setBag[x.first] * x.second;
      cout << res << endl;
    } else {
      long long k, x;
      cin >> k >> x;
      k--;
      if (!bigSet[k]) {
        for (long long a : sets[k]) {
          if (bigNum[a])
            numBag[a] += x;
          else
            for (long long v : inSet[a]) sum[v] += x;
        }
      } else
        setBag[k] += x;
    }
  }
  return 0;
}
