#include <bits/stdc++.h>
using namespace std;
bool big[100005];
vector<int> vec[100005];
vector<pair<int, int> > insec[100005];
vector<int> heavy;
long long ara[100005], sum[100005], sumeach[100005];
int main() {
  long long n, m, q;
  while (scanf("%lld", &n) != EOF) {
    heavy.clear();
    scanf("%lld", &m);
    scanf("%lld", &q);
    long long sq = sqrt((double)n);
    for (long long i = 1; i <= n; i++) {
      scanf("%lld", &ara[i]);
    }
    for (long long i = 1; i <= m; i++) {
      vec[i].clear();
      insec[i].clear();
      sum[i] = sumeach[i] = 0;
      long long k;
      scanf("%lld", &k);
      for (long long j = 1; j <= k; j++) {
        long long x;
        scanf("%lld", &x);
        vec[i].push_back(x);
        sum[i] += ara[x];
      }
      sort(vec[i].begin(), vec[i].end());
      if (k >= sq) {
        big[i] = 1;
        heavy.push_back(i);
      } else
        big[i] = 0;
    }
    for (long long i = 1; i <= m; i++) {
      for (long long li = 0; li < heavy.size(); li++) {
        long long ekhon = heavy[li];
        if (i == ekhon) continue;
        long long p = 0;
        long long cnt = 0;
        for (long long k = 0; k < vec[i].size(); k++) {
          while (p < vec[ekhon].size() && vec[ekhon][p] < vec[i][k]) p++;
          if (p < vec[ekhon].size() && vec[ekhon][p] == vec[i][k]) cnt++;
        }
        insec[i].push_back(pair<int, int>(ekhon, cnt));
      }
    }
    while (q--) {
      char ch;
      scanf(" %c", &ch);
      if (ch == '+') {
        long long k, x;
        scanf("%lld", &k);
        scanf("%lld", &x);
        if (big[k] == 1) {
          sumeach[k] += x;
        } else {
          for (long long i = 0; i < vec[k].size(); i++) {
            ara[vec[k][i]] += x;
          }
          for (long long i = 0; i < insec[k].size(); i++) {
            sum[insec[k][i].first] += x * insec[k][i].second;
          }
        }
      } else {
        long long k;
        scanf("%lld", &k);
        long long ans = 0;
        if (big[k] == 1) {
          ans += sum[k] + sumeach[k] * vec[k].size();
        } else {
          for (long long i = 0; i < vec[k].size(); i++) ans += ara[vec[k][i]];
        }
        for (long long i = 0; i < insec[k].size(); i++) {
          ans += sumeach[insec[k][i].first] * insec[k][i].second;
        }
        printf("%lld\n", ans);
      }
    }
  }
}
