#include <bits/stdc++.h>
using namespace std;
void read(int& x) {
  bool fu = 0;
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  if (c == '-') fu = 1, c = getchar();
  for (x = 0; c > 32; c = getchar()) x = x * 10 + c - '0';
  if (fu) x = -x;
};
void read(long long& x) {
  bool fu = 0;
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  if (c == '-') fu = 1, c = getchar();
  for (x = 0; c > 32; c = getchar()) x = x * 10 + c - '0';
  if (fu) x = -x;
};
char getc() {
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  return c;
}
const int C = 300;
const int N = 100010;
int n, m, q, i, j, k, l, p, x, y, lis[N], ti[N], cnt, home[N];
long long res;
long long a[N];
vector<int> V[N];
vector<int>::iterator pos;
vector<pair<int, int> > G[N];
vector<pair<int, int> > E[N / C + 10];
vector<pair<int, int> >::iterator it;
long long ans[N / C + 10], add[N / C + 10];
int main() {
  read(n);
  read(m);
  read(q);
  for (i = 1; i <= n; i++) read(a[i]);
  for (i = 1; i <= m; i++) {
    for (read(p); p; p--) read(x), V[i].push_back(x);
    if (V[i].size() >= C) lis[++lis[0]] = i, home[i] = lis[0];
  }
  for (l = 1; l <= lis[0]; l++) {
    i = lis[l];
    for (pos = V[i].begin(); pos != V[i].end(); pos++)
      ti[*pos] = l, ans[l] += a[*pos];
    for (j = 1; j <= m; j++)
      if (i != j) {
        cnt = 0;
        for (pos = V[j].begin(); pos != V[j].end(); pos++)
          if (ti[(*pos)] == l) cnt++;
        if (cnt > 0) {
          G[j].push_back(make_pair(l, cnt));
          if (home[j]) E[l].push_back(make_pair(home[j], cnt));
        }
      }
  }
  char ch;
  for (; q; q--) {
    ch = getc();
    if (ch == '?') {
      read(x);
      if (V[x].size() >= C)
        printf("%I64d\n", ans[home[x]]);
      else {
        res = 0;
        for (pos = V[x].begin(); pos != V[x].end(); pos++) res += a[*pos];
        for (it = G[x].begin(); it != G[x].end(); it++)
          res += 1LL * add[it->first] * (it->second);
        printf("%I64d\n", res);
      }
    } else if (ch == '+') {
      read(x);
      read(y);
      if (V[x].size() >= C) {
        i = home[x];
        ans[i] += 1LL * V[x].size() * y;
        for (it = E[i].begin(); it != E[i].end(); it++)
          ans[it->first] += 1LL * y * it->second;
        add[i] += y;
      } else {
        for (pos = V[x].begin(); pos != V[x].end(); pos++) a[*pos] += y;
        for (it = G[x].begin(); it != G[x].end(); it++)
          ans[it->first] += 1LL * y * it->second;
      }
    }
  }
  scanf("\n");
  return 0;
}
