#include <bits/stdc++.h>
using namespace std;
const int max_N = 100000 + 10;
const int sq = 320;
bool mark[max_N];
vector<int> s[max_N], vc;
int pt[max_N], cm[sq + 10][max_N];
long long a[max_N], lazy[sq + 10], sum[sq + 10];
void add(int o, int k, long long x) {
  if (o != -1) {
    lazy[o] += x;
    for (int i = 0; i < (int)vc.size(); i++)
      sum[i] += (i == o) ? 0 : (long long)cm[i][k] * x;
    return;
  }
  for (int i : s[k]) a[i] += x;
  for (int i = 0; i < (int)vc.size(); i++) sum[i] += (long long)cm[i][k] * x;
}
long long get(int o, int k) {
  if (o != -1) return lazy[o] * (long long)s[k].size() + sum[o];
  long long ret(0);
  for (int i : s[k]) ret += a[i];
  for (int i = 0; i < (int)vc.size(); i++) ret += lazy[i] * (long long)cm[i][k];
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  int n, m, q, k, x;
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  memset(pt, -1, sizeof pt);
  for (int i = 0; i < m; i++) {
    cin >> k;
    if (k > sq) {
      vc.push_back(i);
      pt[i] = (int)vc.size() - 1;
    }
    for (int j = 0; j < k; j++) {
      cin >> x;
      x--;
      s[i].push_back(x);
      if (k > sq) sum[pt[i]] += a[x];
    }
  }
  for (int i = 0; i < (int)vc.size(); i++) {
    memset(mark, 0, sizeof mark);
    for (int j : s[vc[i]]) mark[j] = true;
    for (int j = 0; j < m; j++) {
      if (vc[i] == j) continue;
      for (int k : s[j])
        if (mark[k]) cm[i][j]++;
    }
  }
  char ch;
  while (q--) {
    cin >> ch >> k;
    k--;
    if (ch == '+') {
      cin >> x;
      add(pt[k], k, x);
    } else
      cout << get(pt[k], k) << endl;
  }
  return 0;
}
