#include <bits/stdc++.h>
using namespace std;
long long int lazy[320];
int auxi[100005][2];
long long int sum[320];
bool big[320][100005];
int intersection[320][100005];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n, m, q, i, j, k, x;
  cin >> n >> m >> q;
  long long int a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  vector<vector<int> > v;
  int bigcount = 0, smallcount = 0;
  for (i = 0; i < m; i++) {
    int siz;
    cin >> siz;
    vector<int> temp;
    for (j = 0; j < siz; j++) {
      cin >> x;
      x--;
      temp.push_back(x);
    }
    v.push_back(temp);
    if (siz >= sqrt(n)) {
      auxi[i][0] = bigcount++;
      auxi[i][1] = -1;
    } else {
      auxi[i][0] = -1;
      auxi[i][1] = smallcount++;
    }
  }
  for (i = 0; i < m; i++) {
    if (auxi[i][0] != -1) {
      for (j = 0; j < v[i].size(); j++) {
        big[auxi[i][0]][v[i][j]] = true;
        sum[auxi[i][0]] += a[v[i][j]];
      }
    }
  }
  for (i = 0; i < m; i++) {
    if (auxi[i][0] != -1) {
      for (j = 0; j < m; j++) {
        if (j == i) continue;
        int count = 0;
        for (k = 0; k < v[j].size(); k++) {
          if (big[auxi[i][0]][v[j][k]]) count++;
        }
        intersection[auxi[i][0]][j] = count;
      }
    }
  }
  while (q--) {
    char c;
    cin >> c;
    if (c == '?') {
      cin >> k;
      k--;
      if (auxi[k][0] != -1) {
        long long int total = sum[auxi[k][0]];
        for (i = 0; i < 320; i++) {
          total += ((long long int)intersection[i][k] * lazy[i]);
        }
        cout << total << "\n";
      } else {
        long long int total = 0;
        for (i = 0; i < v[k].size(); i++) {
          total += a[v[k][i]];
        }
        for (i = 0; i < 320; i++) {
          total += ((long long int)intersection[i][k] * lazy[i]);
        }
        cout << total << "\n";
      }
    } else {
      cin >> k >> x;
      k--;
      if (auxi[k][0] != -1) {
        lazy[auxi[k][0]] += x;
        sum[auxi[k][0]] += (v[k].size() * x);
      } else {
        for (i = 0; i < v[k].size(); i++) {
          a[v[k][i]] += x;
        }
        for (i = 0; i < 320; i++) {
          sum[i] += ((long long int)intersection[i][k] * x);
        }
      }
    }
  }
}
