#include <bits/stdc++.h>
using namespace std;
vector<vector<long long int> > st, inter;
vector<long long int> heavySet, num, type, original, sum;
vector<vector<bool> > heavyElement;
int n, m, q, h;
int common(int a, int b) {
  int ans = 0, asz = st[a].size();
  for (int i = 0; i < asz; i++) {
    if (heavyElement[b][st[a][i]] == true) {
      ans += 1;
    }
  }
  return ans;
}
void getIntersection(void) {
  inter.clear();
  inter.resize(m);
  for (int i = 0; i < m; i++) {
    inter[i].resize(h);
    for (int j = 0; j < h; j++) {
      inter[i][j] = common(i, j);
    }
  }
}
void query(void) {
  char ch;
  int idx, value;
  for (int i = 0; i < q; i++) {
    cin >> ch >> idx;
    idx -= 1;
    if (ch == '?') {
      long long int ans = 0;
      if (type[idx] == -1) {
        int k = st[idx].size();
        for (int i = 0; i < k; i++) {
          ans += num[st[idx][i]];
        }
        for (int i = 0; i < h; i++) {
          ans += (inter[idx][i] * sum[i]);
        }
      } else {
        ans = original[type[idx]];
        for (int i = 0; i < h; i++) {
          ans += (sum[i] * inter[idx][i]);
        }
      }
      cout << ans << endl;
    } else {
      cin >> value;
      if (type[idx] == -1) {
        int k = st[idx].size();
        for (int i = 0; i < k; i++) {
          num[st[idx][i]] += value;
        }
        for (int i = 0; i < h; i++) {
          original[i] += (inter[idx][i] * value);
        }
      } else {
        sum[type[idx]] += value;
      }
    }
  }
}
int main(void) {
  while (cin >> n >> m >> q) {
    num.resize(n);
    for (int i = 0; i < n; i++) {
      cin >> num[i];
    }
    int k;
    original.clear();
    heavyElement.clear();
    st.clear();
    st.resize(m);
    heavySet.clear();
    type.clear();
    type.resize(n, -1);
    h = 0;
    for (int i = 0; i < m; i++) {
      cin >> k;
      st[i].resize(k);
      long long int s = 0;
      vector<bool> element(n, false);
      for (int j = 0; j < k; j++) {
        cin >> st[i][j];
        st[i][j] -= 1;
        s += num[st[i][j]];
        element[st[i][j]] = true;
      }
      if (k >= sqrt(n)) {
        heavySet.push_back(i);
        original.push_back(s);
        heavyElement.push_back(element);
        type[i] = h;
        h += 1;
      }
    }
    sum.clear();
    sum.resize(h, 0);
    getIntersection();
    query();
  }
  return 0;
}
