#include <bits/stdc++.h>
using namespace std;
const int oo = 1000000;
const int N = 100005, sqrt1 = 550, sqrts = N / sqrt1 + 5;
long long arr[N], set_sum[N], to_add[N];
vector<int> sets[N];
int heavy_id[N], heavy_cnt = 0;
vector<int> heavy_sets;
int intersection_size[sqrts][N];
bool set_contain[sqrts][N];
long long query(int id) {
  long long ret = set_sum[id];
  for (int i = 0; i < heavy_sets.size(); ++i) {
    ret += intersection_size[i][id] * to_add[heavy_sets[i]];
  }
  if (heavy_id[id] == -1) {
    for (int i = 0; i < sets[id].size(); ++i) {
      ret += arr[sets[id][i]];
    }
  }
  return ret;
}
void update(int id, int val) {
  if (heavy_id[id] != -1) {
    to_add[id] += val;
  } else {
    for (int i = 0; i < heavy_sets.size(); ++i) {
      set_sum[heavy_sets[i]] += intersection_size[i][id] * val;
    }
    for (int i = 0; i < sets[id].size(); ++i) {
      arr[sets[id][i]] += val;
    }
  }
}
int main() {
  int n, m, q;
  scanf("%d %d %d", &n, &m, &q);
  for (int i = 0; i < n; ++i) {
    scanf("%lld", &arr[i]);
  }
  memset(heavy_id, -1, sizeof heavy_id);
  for (int i = 0; i < m; ++i) {
    int k;
    scanf("%d", &k);
    while (k-- > 0) {
      int x;
      scanf("%d", &x);
      --x;
      sets[i].push_back(x);
      set_sum[i] += arr[x];
    }
    if (sets[i].size() > sqrt1) {
      for (int j = 0; j < sets[i].size(); ++j) {
        set_contain[heavy_cnt][sets[i][j]] = true;
      }
      heavy_sets.push_back(i);
      heavy_id[i] = heavy_cnt++;
    }
  }
  for (int i = 0; i < n; ++i) {
    arr[i] = 0;
  }
  for (int _i = 0; _i < heavy_sets.size(); ++_i) {
    int i = heavy_sets[_i];
    for (int j = 0; j < n; ++j) {
      for (int k = 0; k < sets[j].size(); ++k) {
        if (set_contain[_i][sets[j][k]]) {
          intersection_size[_i][j]++;
        }
      }
    }
  }
  while (q-- > 0) {
    char op;
    int k;
    scanf(" %c %d", &op, &k);
    --k;
    if (op == '?') {
      printf("%lld\n", query(k));
    } else {
      int x;
      scanf("%d", &x);
      update(k, x);
    }
  }
  return 0;
}
