#include <bits/stdc++.h>
using namespace std;
const long long int M = 1e5 + 5, LG = 26, SM = 800, inf = 1e9 + 1,
                    mod = 95542721;
long long int n, m, q;
vector<long long int> se[M];
long long int bt = 0;
long long int bigs[SM];
long long int bigid[M];
long long int esht[M][200];
bool sel[M];
long long int ezf[SM];
long long int sum[SM];
long long int a[M];
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    long long int x;
    cin >> x;
    se[i].resize(x);
    bigid[i] = -1;
    if (x > SM) {
      bigid[i] = bt;
      bigs[bt++] = i;
    }
    for (int j = 0; j < x; j++) {
      cin >> se[i][j];
      se[i][j]--;
    }
  }
  for (int ii = 0; ii < bt; ii++) {
    long long int i = bigs[ii];
    for (long long int x : se[i]) sum[ii] += a[x];
  }
  for (int ii = 0; ii < bt; ii++) {
    long long int i = bigs[ii];
    for (int j = 0; j < n; j++) sel[j] = 0;
    for (long long int x : se[i]) sel[x] = 1;
    for (int j = 0; j < m; j++) {
      esht[j][ii] = 0;
      for (long long int x : se[j]) esht[j][ii] += sel[x];
    }
  }
  while (q--) {
    char c;
    cin >> c;
    long long int x;
    cin >> x;
    x--;
    if (c == '?') {
      if (bigid[x] == -1) {
        long long int skm = 0;
        for (long long int y : se[x]) skm += a[y];
        for (int i = 0; i < bt; i++) {
          skm += ezf[i] * esht[x][i];
        }
        cout << skm << '\n';
      } else {
        cout << sum[bigid[x]] << '\n';
      }
    } else {
      long long int v;
      cin >> v;
      if (bigid[x] == -1) {
        for (long long int y : se[x]) a[y] += v;
      } else
        ezf[bigid[x]] += v;
      for (int i = 0; i < bt; i++) {
        sum[i] += v * esht[x][i];
      }
    }
  }
}
