#include <bits/stdc++.h>
using namespace std;
static const int maxn = 1e5 + 5;
static const int maxb = 320;
vector<int> light_set[maxn];
vector<int> heavy_set[maxb];
int light_heavy_intersection[maxn][maxb];
int heavy_heavy_intersection[maxb][maxb];
int num_ele[maxn];
int mapper[maxn];
long long lazy[maxn];
long long ans_light[maxn];
long long ans_heavy[maxn];
long long arr[maxn];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  int light = 0;
  int heavy = 0;
  for (int i = 1; i <= m; i++) {
    cin >> num_ele[i];
    if (num_ele[i] > maxb) {
      mapper[i] = ++heavy;
      long long sum = 0;
      for (int j = 1; j <= num_ele[i]; j++) {
        int p;
        cin >> p;
        heavy_set[heavy].push_back(p);
        sum += arr[p];
      }
      sort(heavy_set[heavy].begin(), heavy_set[heavy].end());
      ans_heavy[heavy] = sum;
    } else {
      mapper[i] = ++light;
      light_set[light].resize(num_ele[i]);
      long long sum = 0;
      for (int &x : light_set[light]) {
        cin >> x;
        sum += arr[x];
      }
      sort(light_set[light].begin(), light_set[light].end());
      ans_light[light] = sum;
    }
  }
  auto get = [&](vector<int> &vec, int key) {
    return binary_search(vec.begin(), vec.end(), key);
  };
  for (int lgt = 1; lgt <= light; lgt++) {
    for (int x : light_set[lgt]) {
      for (int hvy = 1; hvy <= heavy; hvy++)
        light_heavy_intersection[lgt][hvy] += get(heavy_set[hvy], x);
    }
  }
  for (int hvy = 1; hvy <= heavy; hvy++) {
    for (int x : heavy_set[hvy]) {
      for (int i = 1; i <= heavy; i++)
        if (i != hvy) heavy_heavy_intersection[hvy][i] += get(heavy_set[i], x);
    }
  }
  while (q--) {
    char type;
    cin >> type;
    if (type == '?') {
      int x;
      cin >> x;
      if (num_ele[x] > maxb) {
        int hvy = mapper[x];
        long long res = ans_heavy[hvy] + 1LL * num_ele[x] * lazy[hvy];
        for (int i = 1; i <= heavy; i++)
          if (hvy != i) res += heavy_heavy_intersection[hvy][i] * lazy[i];
        cout << res << '\n';
      } else {
        int lgt = mapper[x];
        long long res = 0;
        for (int p : light_set[lgt]) res += arr[p];
        for (int z = 1; z <= heavy; z++)
          res += (light_heavy_intersection[lgt][z] * lazy[z]);
        cout << res << '\n';
      }
    } else {
      int x;
      long long val;
      cin >> x >> val;
      if (num_ele[x] > maxb) {
        int hvy = mapper[x];
        lazy[hvy] += val;
      } else {
        int lgt = mapper[x];
        for (int p : light_set[lgt]) arr[p] += val;
        for (int hvy = 1; hvy <= heavy; hvy++)
          ans_heavy[hvy] += (light_heavy_intersection[lgt][hvy] * val);
      }
    }
  }
}
