#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10, inf = 1e9 + 10, MOD = 1e9 + 7, Sq = 317;
int n, m, q, t, x, id[maxn], cnt = 0, sh[maxn][Sq + 10], y;
long long a[maxn], counter[Sq + 10], s[Sq + 10];
vector<int> h[Sq + 10], l[maxn], v[maxn];
char ch;
void get(char c, int ind, int t) {
  if (c == 'H') {
    id[ind] = cnt++;
    for (int i = 0; i < t; i++) {
      cin >> x;
      x--;
      s[id[ind]] += a[x];
      v[x].push_back(id[ind]);
      h[id[ind]].push_back(x);
    }
  } else {
    for (int i = 0; i < t; i++) {
      cin >> x;
      x--;
      l[ind].push_back(x);
    }
  }
}
void Find_sh(char c, int ind) {
  if (c == 'H') {
    for (int i : h[id[ind]])
      for (int j : v[i])
        if (j != id[ind]) sh[ind][j]++;
  } else {
    for (int i : l[ind])
      for (int j : v[i]) sh[ind][j]++;
  }
}
long long Find_ans(char c, int ind) {
  long long ans = 0;
  if (c == 'H') {
    ans = s[id[ind]] + counter[id[ind]] * h[id[ind]].size();
    for (int i = 0; i < cnt; i++)
      if (id[ind] != i) ans += 1ll * sh[ind][i] * counter[i];
  } else {
    for (int i : l[ind]) ans += a[i];
    for (int i = 0; i < cnt; i++) ans += 1ll * sh[ind][i] * counter[i];
  }
  return ans;
}
void add(char c, int ind, int x) {
  if (c == 'H')
    counter[id[ind]] += x;
  else {
    for (int i : l[ind]) a[i] += x;
    for (int i = 0; i < cnt; i++) s[i] += sh[ind][i] * x;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  memset(id, -1, sizeof(id));
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) {
    cin >> t;
    if (t >= Sq)
      get('H', i, t);
    else
      get('L', i, t);
  }
  for (int i = 0; i < m; i++) {
    if (id[i] == -1)
      Find_sh('L', i);
    else
      Find_sh('H', i);
  }
  for (int i = 0; i < q; i++) {
    cin >> ch;
    if (ch == '?') {
      cin >> x;
      x--;
      if (id[x] == -1)
        cout << Find_ans('L', x) << endl;
      else
        cout << Find_ans('H', x) << endl;
    } else {
      cin >> x >> y;
      x--;
      if (id[x] == -1)
        add('L', x, y);
      else
        add('H', x, y);
    }
  }
  return 0;
}
