#include <bits/stdc++.h>
using namespace std;
vector<int> s[100005];
long long a[100005];
bool vis[100005];
long long val[100005];
int type[100005], u[100005], v[100005];
int bigNumber[100005], bigPos[335];
int bigAdj[335][100005];
long long wei[100005], tmpVal[100005];
int tmp[100005];
void solve() {
  int nn, m, q;
  scanf("%d %d %d", &nn, &m, &q);
  for (int i = 1; i <= nn; ++i) {
    scanf("%lld ", &a[i]);
  }
  int pos = 0;
  for (int i = 1; i <= m; ++i) {
    int k, x;
    scanf("%d  ", &k);
    if (k >= 335) {
      bigNumber[i] = pos;
      bigPos[pos++] = i;
    }
    while (k--) {
      scanf("%d ", &x);
      s[i].push_back(x);
    }
  }
  for (int i = 0; i < pos; ++i) {
    for (int x : s[bigPos[i]]) {
      vis[x] = true;
    }
    for (int j = m; j; --j) {
      for (int x : s[j]) {
        if (vis[x]) {
          ++bigAdj[i][j];
        }
      }
    }
    for (int x : s[bigPos[i]]) {
      vis[x] = false;
    }
  }
  char str[123];
  for (int i = 1; i <= q; ++i) {
    scanf(" %s %d", str, &u[i]);
    if (str[0] == '?') {
      type[i] = 1;
    } else {
      type[i] = 2;
      scanf(" %d ", &v[i]);
    }
  }
  for (int ii = 1; ii <= q; ii += 335) {
    int ed = min(ii + 335 - 1, q);
    set<int> rr;
    for (int j = ii; j <= ed; ++j) {
      rr.insert(u[j]);
    }
    int p = 0;
    for (int x : rr) {
      tmp[p++] = x;
    }
    for (int j = 0; j < p; ++j) {
      int id = tmp[j];
      wei[tmp[j]] = tmpVal[tmp[j]] = 0;
      for (int x : s[id]) {
        tmpVal[tmp[j]] += a[x];
      }
    }
    for (int j = ii; j <= ed; ++j) {
      int ver = u[j];
      if (type[j] == 1) {
        long long ret = 0;
        if (s[ver].size() < 335) {
          for (int x : s[ver]) {
            ret += a[x];
          }
          for (int k = 0; k < p; ++k) {
            int node = tmp[k];
            if (s[node].size() >= 335) {
              ret += wei[node] * bigAdj[bigNumber[node]][ver];
            }
          }
        } else {
          ret = tmpVal[ver];
          for (int k = 0; k < p; ++k) {
            int node = tmp[k];
            ret += wei[node] * bigAdj[bigNumber[ver]][node];
          }
        }
        printf("%lld\n", ret);
      } else {
        int w = v[j];
        wei[ver] += w;
        if (s[ver].size() < 335) {
          for (int x : s[ver]) {
            a[x] += w;
          }
        }
      }
    }
    for (int j = 0; j < p; ++j) {
      int id = tmp[j];
      if (s[id].size() >= 335) {
        for (int x : s[id]) {
          a[x] += wei[id];
        }
      }
    }
  }
}
int main() {
  solve();
  return 0;
}
