#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const int maxn = 1e5 + 10, SQ = 365;
int n, m, q;
long long a[maxn];
vector<int> s[maxn];
vector<int> red, black;
long long sum[maxn], operation[500];
bool help[maxn];
int inter[500][maxn], inter1[500][500];
int val[maxn];
void add(int k, long long x) {
  int n = s[k].size();
  if (n > SQ) {
    sum[k] += x * (1LL * s[k].size());
    operation[val[k]] += x;
  } else {
    for (int si : s[k]) a[si] += x;
    for (int i = 0; i < red.size(); i++) sum[red[i]] += (1LL * inter[i][k]) * x;
  }
}
long long solve(int k) {
  int n = s[k].size();
  if (n > SQ) {
    long long res = sum[k];
    for (int i = 0; i < red.size(); i++)
      res += (1LL * inter1[val[k]][i]) * operation[i];
    return res;
  } else {
    long long res = 0;
    for (int si : s[k]) res += a[si];
    for (int i = 0; i < red.size(); i++)
      res += (1LL * inter[i][k]) * operation[i];
    return res;
  }
}
void pre() {
  for (int i = 0; i < red.size(); i++) {
    fill(help, help + maxn, 0);
    for (int si : s[red[i]]) help[si] = 1;
    for (int j : black)
      for (int si : s[j]) inter[i][j] += help[si];
    for (int j = 0; j < red.size(); j++)
      if (j != i)
        for (int si : s[red[j]]) inter1[i][j] += help[si];
  }
  for (int i = 0; i < m; i++)
    for (int si : s[i]) sum[i] += a[si];
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  int pt = 0;
  for (int i = 0; i < m; i++) {
    int n;
    cin >> n;
    if (n > SQ)
      red.push_back(i), val[i] = pt++;
    else
      black.push_back(i);
    int si;
    while (n--) cin >> si, si--, s[i].push_back(si);
  }
  pre();
  char type;
  long long k, x;
  while (q--) {
    cin >> type;
    if (type == '?') {
      cin >> k, k--;
      cout << solve(k) << '\n';
    } else {
      cin >> k >> x, k--;
      add(k, x);
    }
  }
}
