#include <bits/stdc++.h>
using namespace std;
long long Set(long long n, long long pos) { return n | (1LL << pos); }
bool Check(long long n, long long pos) { return (bool)(n & (1LL << pos)); }
long long a[100010];
long long sum[100010];
long long sumeach[100010];
vector<int> vec[100010];
vector<int> bigs;
vector<pair<long long, long long> > inter[100010];
bool big[100010];
int main() {
  int cs, ts, i, j, k, x, y, z, q, m, n, v;
  while (scanf("%d", &n) != EOF) {
    scanf("%d", &m);
    scanf("%d", &q);
    int sq = sqrt((double)n);
    for (i = 1; i <= n; i++) scanf("%lld", &a[i]);
    bigs.clear();
    for (i = 1; i <= m; i++) {
      vec[i].clear();
      inter[i].clear();
      sum[i] = sumeach[i] = 0;
      scanf("%d", &k);
      while (k--) {
        scanf("%d", &x);
        vec[i].push_back(x);
        sum[i] += (long long)a[x];
      }
      sort(vec[i].begin(), vec[i].end());
      if (vec[i].size() >= sq)
        big[i] = 1;
      else
        big[i] = 0;
      if (big[i]) bigs.push_back(i);
    }
    for (i = 1; i <= m; i++) {
      for (int li = 0; li < bigs.size(); li++) {
        j = bigs[li];
        if (i == j) continue;
        int p = 0;
        long long cnt = 0;
        for (k = 0; k < vec[i].size(); k++) {
          while (p < vec[j].size() && vec[j][p] < vec[i][k]) p++;
          if (p < vec[j].size() && vec[j][p] == vec[i][k]) cnt++;
        }
        inter[i].push_back(pair<long long, long long>(j, cnt));
      }
    }
    while (q--) {
      char ch;
      scanf(" %c", &ch);
      if (ch == '+') {
        long long x;
        scanf("%d", &k);
        scanf("%lld", &x);
        if (big[k]) {
          sumeach[k] += (long long)x;
        } else {
          for (i = 0; i < vec[k].size(); i++) {
            a[vec[k][i]] += (long long)x;
          }
          for (i = 0; i < inter[k].size(); i++) {
            sum[inter[k][i].first] += (long long)x * inter[k][i].second;
          }
        }
      } else {
        scanf("%d", &k);
        long long ans = 0;
        if (big[k]) {
          ans += sum[k] + sumeach[k] * vec[k].size();
        } else {
          for (i = 0; i < vec[k].size(); i++) {
            ans += a[vec[k][i]];
          }
        }
        for (i = 0; i < inter[k].size(); i++) {
          ans += sumeach[inter[k][i].first] * inter[k][i].second;
        }
        printf("%lld\n", ans);
      }
    }
  }
  return 0;
}
