#include <bits/stdc++.h>
using namespace std;
int fx[] = {1, -1, 0, 0};
int fy[] = {0, 0, 1, -1};
long long n, m, q;
const long long sq = sqrt(100005);
long long arr[100005], cnt[100005], sum[100005], flag[100005];
vector<long long> V[100005], heavy;
vector<pair<long long, long long> > inter[100005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> q;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  for (int i = 1; i <= m; i++) {
    cin >> cnt[i];
    long long s = 0;
    for (int j = 0; j < cnt[i]; j++) {
      long long tmp;
      cin >> tmp;
      s += arr[tmp];
      V[i].push_back(tmp);
    }
    sort(V[i].begin(), V[i].end());
    sum[i] = s;
    if (cnt[i] >= sq) heavy.push_back(i);
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j < heavy.size(); j++) {
      long long id = heavy[j];
      if (i == id) continue;
      long long c = 0;
      for (int k = 0; k < cnt[i]; k++) {
        if (binary_search(V[id].begin(), V[id].end(), V[i][k])) c++;
      }
      if (c > 0) inter[i].push_back(pair<long long, long long>(id, c));
    }
  }
  while (q--) {
    char ch;
    cin >> ch;
    if (ch == '?') {
      long long k;
      cin >> k;
      if (cnt[k] >= sq) {
        long long ans = sum[k] + flag[k] * cnt[k];
        for (int i = 0; i < inter[k].size(); i++)
          ans += flag[inter[k][i].first] * inter[k][i].second;
        cout << ans << '\n';
      } else {
        long long ans = 0;
        for (int i = 0; i < cnt[k]; i++) ans += arr[V[k][i]];
        for (int i = 0; i < inter[k].size(); i++)
          ans += flag[inter[k][i].first] * inter[k][i].second;
        cout << ans << '\n';
      }
    } else {
      long long k, x;
      cin >> k >> x;
      if (cnt[k] >= sq) {
        flag[k] += x;
      } else {
        for (int i = 0; i < cnt[k]; i++) arr[V[k][i]] += x;
        for (int i = 0; i < inter[k].size(); i++)
          sum[inter[k][i].first] += x * inter[k][i].second;
      }
    }
  }
  return 0;
}
