#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;
const int B = 500;
int n, m, q;
long long arr[N];
vector<int> heavy;
vector<bitset<N>> cont;
struct Set {
  long long sum;
  long long lzy;
  int cnt;
  bool heavy;
  vector<int> elem;
  vector<int> intsec;
} st[N];
void input() {
  cin >> n >> m >> q;
  for (int i = 1; i <= n; ++i) {
    cin >> arr[i];
  }
  for (int i = 1; i <= m; ++i) {
    cin >> st[i].cnt;
    if (st[i].cnt >= B) {
      st[i].heavy = 1;
      heavy.push_back(i);
      cont.push_back(0);
    } else {
      st[i].heavy = 0;
    }
    for (int j = 0; j < st[i].cnt; ++j) {
      int key;
      cin >> key;
      st[i].sum += arr[key];
      st[i].elem.push_back(key);
      if (st[i].heavy) {
        cont.back()[key] = 1;
      }
    }
  }
}
void intersections() {
  for (int i = 1; i <= m; ++i) {
    for (int j = 0; j < heavy.size(); ++j) {
      int intsec = 0;
      for (int key : st[i].elem) {
        intsec += cont[j][key];
      }
      st[i].intsec.push_back(intsec);
    }
  }
}
void updateLight(int id, int val) {
  for (int key : st[id].elem) {
    arr[key] += val;
  }
  for (int i = 0; i < heavy.size(); ++i) {
    int j = heavy[i];
    st[j].sum += (long long)val * st[id].intsec[i];
  }
}
void updateHeavy(int id, int val) {
  st[id].sum += (long long)val * st[id].cnt;
  st[id].lzy += val;
}
long long sumLight(int id) {
  long long res = 0;
  for (int key : st[id].elem) {
    res += arr[key];
  }
  for (int i = 0; i < heavy.size(); ++i) {
    int j = heavy[i];
    res += (long long)st[id].intsec[i] * st[j].lzy;
  }
  return res;
}
long long sumHeavy(int id) {
  long long res = st[id].sum;
  for (int i = 0; i < heavy.size(); ++i) {
    int j = heavy[i];
    if (j == id) {
      continue;
    }
    res += (long long)st[id].intsec[i] * st[j].lzy;
  }
  return res;
}
void solve() {
  intersections();
  for (int i = 0; i < q; ++i) {
    char t;
    cin >> t;
    if (t == '+') {
      int id;
      cin >> id;
      int val;
      cin >> val;
      if (st[id].heavy) {
        updateHeavy(id, val);
      } else {
        updateLight(id, val);
      }
    }
    if (t == '?') {
      int id;
      cin >> id;
      if (st[id].heavy) {
        cout << sumHeavy(id) << "\n";
      } else {
        cout << sumLight(id) << "\n";
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  input();
  solve();
}
