#include <bits/stdc++.h>
using namespace std;
template <class T>
string ToString(T t) {
  stringstream s;
  s << t;
  return s.str();
}
template <class T>
void ToOther(T& t, string a) {
  stringstream s(a);
  s >> t;
}
int n, m, Q;
long long a[100005];
long long sum[100005];
vector<int> v[100005];
vector<int> big;
int cnt[100005][405];
long long added[100005];
long long calc(int x) {
  if (v[x].size() <= 333) {
    long long r = 0;
    for (int i = 0; i < v[x].size(); i++) r += a[v[x][i]];
    for (int k = 0; k < big.size(); k++) r += cnt[x][k] * added[big[k]];
    return r;
  } else
    return sum[x];
}
void up(int x, int y) {
  added[x] += y;
  for (int k = 0; k < big.size(); k++) sum[big[k]] += (long long)cnt[x][k] * y;
  if (v[x].size() <= 333) {
    for (int i = 0; i < v[x].size(); i++) a[v[x][i]] += y;
  }
}
void init() {
  for (int i = 0; i < m; i++) {
    for (int k = 0; k < big.size(); k++) {
      for (int j = 0; j < v[i].size(); j++) {
        cnt[i][k] +=
            binary_search((v[big[k]]).begin(), (v[big[k]]).end(), v[i][j]);
      }
    }
  }
}
int main() {
  cin >> n >> m >> Q;
  for (int i = 0; i < n; i++) {
    int t;
    scanf("%d", &t);
    a[i] = t;
  }
  for (int i = 0; i < m; i++) {
    int len;
    scanf("%d", &len);
    for (int k = 0; k < len; k++) {
      int t;
      scanf("%d", &t);
      t--;
      v[i].push_back(t);
      sum[i] += a[t];
    }
    sort((v[i]).begin(), (v[i]).end());
    if (len > 333) big.push_back(i);
  }
  init();
  while (Q--) {
    char op[255];
    int x, y;
    scanf("%s", op);
    if (op[0] == '?') {
      scanf("%d", &x);
      x--;
      printf("%I64d\n", calc(x));
    } else {
      scanf("%d %d", &x, &y);
      x--;
      up(x, y);
    }
  }
}
