#include <bits/stdc++.h>
using namespace std;
int n, m, q, intersection[500][100100], HeavyN[100100];
bool Light[100100], Heavyin[500][100100];
long long ara[100100], HHupdate[500], HLupdate[500], HeavySum[500];
vector<int> Set[100100], HeavyS;
int main() {
  cin >> n >> m >> q;
  int sq = sqrt(n);
  for (int i = 0; i < n; i++) {
    cin >> ara[i];
  }
  int totelem, index;
  for (int i = 0; i < m; i++) {
    cin >> totelem;
    if (totelem <= sq) {
      Light[i] = 1;
    } else
      HeavyS.push_back(i), HeavyN[i] = HeavyS.size() - 1;
    for (int j = 0; j < totelem; j++) {
      cin >> index;
      index--;
      Set[i].push_back(index);
      if (!Light[i]) {
        Heavyin[HeavyS.size() - 1][index] = 1;
        HeavySum[HeavyS.size() - 1] += ara[index];
      }
    }
  }
  for (int i = 0; i < HeavyS.size(); i++) {
    for (int j = 0; j < n; j++) {
      for (int k = 0; k < Set[j].size(); k++) {
        if (Heavyin[i][Set[j][k]]) intersection[i][j]++;
      }
    }
  }
  string s;
  long long Qs, val;
  for (int i = 0; i < q; i++) {
    long long sum = 0;
    cin >> s >> Qs;
    Qs--;
    if (Light[Qs]) {
      if (s == "+") {
        cin >> val;
        for (int i = 0; i < Set[Qs].size(); i++) ara[Set[Qs][i]] += val;
        for (int i = 0; i < HeavyS.size(); i++) {
          HLupdate[i] += (val * intersection[i][Qs]);
        }
      } else {
        for (int i = 0; i < Set[Qs].size(); i++) sum += ara[Set[Qs][i]];
        for (int i = 0; i < HeavyS.size(); i++)
          sum += (HHupdate[i] * intersection[i][Qs]);
      }
    } else {
      if (s == "+") {
        cin >> val;
        HHupdate[HeavyN[Qs]] += val;
      } else {
        for (int i = 0; i < HeavyS.size(); i++) {
          if (HeavyS[i] != Qs) {
            sum += (HHupdate[i] * intersection[i][Qs]);
          }
        }
        sum += (HHupdate[HeavyN[Qs]] * (Set[Qs].size()));
        sum += HLupdate[HeavyN[Qs]];
        sum += HeavySum[HeavyN[Qs]];
      }
    }
    if (s == "?") cout << sum << endl;
  }
}
