#include <bits/stdc++.h>
using namespace std;
const int Max = 1e5 + 10;
const int Mod = 1e9 + 7;
const long long int Inf = 1LL << 62;
int heavy_sz[Max];
int light_sz[Max];
int isLight[Max];
int isHeavy[Max];
long long int ar[100010];
vector<int> inp_light[Max];
vector<int> inp_heavy[Max];
vector<int> intersection[Max];
int hSelf[1003][1003];
long long int inc[Max];
long long int sum[Max];
int main() {
  int n, m, q, szh = 0, szl = 0;
  scanf("%d %d %d", &n, &m, &q);
  int sq = 3000;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &ar[i]);
  }
  for (int i = 1; i <= m; i++) {
    int x;
    scanf("%d", &x);
    if (x <= sq) {
      szl++;
      light_sz[szl] = x;
      isLight[i] = szl;
      for (int j = 1; j <= x; j++) {
        int y;
        scanf("%d", &y);
        inp_light[szl].push_back(y);
      }
      sort(inp_light[szl].begin(), inp_light[szl].end());
    } else {
      szh++;
      heavy_sz[szh] = x;
      isHeavy[i] = szh;
      for (int j = 1; j <= x; j++) {
        int y;
        scanf("%d", &y);
        sum[szh] += ar[y];
        inp_heavy[szh].push_back(y);
      }
      sort(inp_heavy[szh].begin(), inp_heavy[szh].end());
    }
  }
  for (int i = 1; i <= szl; i++) {
    intersection[i].push_back(0);
    for (int j = 1; j <= szh; j++) {
      intersection[i].push_back(0);
      int tot = 0;
      int p = light_sz[i] - 1;
      int q = heavy_sz[j] - 1;
      int x = 0;
      int y = 0;
      for (int k = 1; k <= p + q + 2; k++) {
        while (inp_light[i][x] < inp_heavy[j][y] && x < p) {
          x++;
        }
        while (inp_heavy[j][y] < inp_light[i][x] && y < q) {
          y++;
        }
        if (inp_light[i][x] == inp_heavy[j][y] && x <= p && y <= q) {
          tot++;
          x++;
          y++;
        }
      }
      intersection[i][j] = tot;
    }
  }
  for (int i = 1; i <= szh; i++) {
    for (int j = 1; j <= szh; j++) {
      if (i == j) {
        continue;
      }
      int tot = 0;
      int p = heavy_sz[i] - 1;
      int q = heavy_sz[j] - 1;
      int x = 0;
      int y = 0;
      for (int k = 1; k <= p + q + 2; k++) {
        while (inp_heavy[i][x] < inp_heavy[j][y] && x < p) {
          x++;
        }
        while (inp_heavy[j][y] < inp_heavy[i][x] && y < q) {
          y++;
        }
        if (inp_heavy[i][x] == inp_heavy[j][y] && x <= p && y <= q) {
          tot++;
          x++;
          y++;
        }
      }
      hSelf[i][j] = tot;
    }
  }
  char ch;
  int x, y;
  while (q--) {
    getchar();
    scanf("%c", &ch);
    if (ch == '+') {
      scanf("%d %d", &y, &x);
      if (isLight[y]) {
        int pos = isLight[y];
        for (int i = 0; i < light_sz[pos]; i++) {
          ar[inp_light[pos][i]] += x;
        }
        for (int i = 1; i <= szh; i++) {
          int tot = intersection[pos][i];
          sum[i] += 1LL * tot * x;
        }
      } else {
        int pos = isHeavy[y];
        inc[pos] += x;
        for (int i = 1; i <= szh; i++) {
          if (i != pos) {
            sum[i] += 1LL * hSelf[pos][i] * x;
          }
        }
      }
    } else {
      scanf("%d", &y);
      long long int ans = 0;
      if (isLight[y]) {
        int pos = isLight[y];
        for (int i = 0; i < light_sz[pos]; i++) {
          ans += ar[inp_light[pos][i]];
        }
        for (int i = 1; i <= szh; i++) {
          int tot = intersection[pos][i];
          ans += 1LL * tot * inc[i];
        }
        printf("%lld\n", ans);
      } else {
        int pos = isHeavy[y];
        long long int ans = sum[pos] + 1LL * inc[pos] * heavy_sz[pos];
        printf("%lld\n", ans);
      }
    }
  }
  return 0;
}
