#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 10, MN = 1e5 + 10, SQ = 666, MP = MN / SQ + 20;
int n, m, q;
long long sm[MN], arr[MN], ad[MN];
vector<int> vec[MN], hv;
unordered_map<int, int> mp[MN];
bool mk[MN];
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m >> q;
  for (int i = 0; i < n; ++i) cin >> arr[i];
  for (int i = 0; i < m; ++i) {
    int L;
    cin >> L;
    while (L--) {
      int x;
      cin >> x;
      --x;
      vec[i].push_back(x);
    }
    sort(vec[i].begin(), vec[i].end());
    if (((int)(vec[i]).size()) >= SQ) hv.push_back(i);
  }
  for (auto x : hv) {
    memset(mk, 0, sizeof mk);
    for (auto y : vec[x]) mk[y] = true;
    for (auto y : vec[x]) sm[x] += arr[y];
    for (int i = 0; i < m; ++i) {
      for (auto y : vec[i]) mp[i][x] += mk[y];
    }
  }
  while (q--) {
    char tp;
    cin >> tp;
    if (tp == '?') {
      int x;
      cin >> x;
      --x;
      long long ans = 0;
      if (((int)(vec[x]).size()) >= SQ) {
        ans = sm[x];
        for (auto y : hv) ans += 1ll * ad[y] * mp[x][y];
      } else {
        for (auto y : vec[x]) ans += arr[y];
        for (auto y : hv) ans += 1ll * ad[y] * mp[x][y];
      }
      cout << ans << '\n';
    } else {
      int x, val;
      cin >> x >> val;
      --x;
      if (((int)(vec[x]).size()) >= SQ)
        ad[x] += val;
      else {
        for (auto y : vec[x]) arr[y] += val;
        for (auto y : hv) sm[y] += 1ll * val * mp[x][y];
      }
    }
  }
  return 0;
}
