#include <bits/stdc++.h>
using namespace std;
char ch;
const int nmax = 320;
bool fix[nmax][nmax * nmax];
long long n, m, q, i, j, x, p, ans;
int c[nmax][nmax * nmax];
long long mas[nmax * nmax], big[nmax], sum[nmax * nmax], add[nmax * nmax];
vector<long long> v[nmax * nmax];
int main() {
  cin >> n >> m >> q;
  for (i = 1; i <= n; i++) cin >> mas[i];
  for (i = 1; i <= m; i++) {
    cin >> q;
    if (q * q > n) big[++p] = i;
    for (j = 1; j <= q; j++) {
      cin >> x;
      v[i].push_back(x);
      sum[i] += mas[x];
      if (q * q > n) fix[p][x] = 1;
    }
  }
  for (i = 1; i <= p; i++)
    for (j = 1; j <= m; j++)
      for (q = 0; q < v[j].size(); q++)
        if (fix[i][v[j][q]]) c[i][j]++;
  while (cin >> ch) {
    cin >> q;
    if (ch == '+') {
      cin >> x;
      if (v[q].size() * v[q].size() > n) add[q] += x;
      if (v[q].size() * v[q].size() <= n) {
        for (i = 0; i < v[q].size(); i++) mas[v[q][i]] += x;
        for (i = 1; i <= p; i++) sum[big[i]] += x * c[i][q];
      }
    }
    if (ch == '?') {
      ans = 0;
      if (v[q].size() * v[q].size() > n)
        ans = sum[q];
      else
        for (i = 0; i < v[q].size(); i++) ans += mas[v[q][i]];
      for (i = 1; i <= p; i++) ans += c[i][q] * add[big[i]];
      cout << ans << endl;
    }
  }
}
