#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const long long inf = numeric_limits<long long>::max() / 2;
const long double eps = 1e-9;
const long double pi = acos(-1);
template <typename T>
inline bool mineq(T& a, T b) {
  return (a > b) ? (a = b, 1) : 0;
}
template <typename T>
inline bool maxeq(T& a, T b) {
  return (a < b) ? (a = b, 1) : 0;
}
inline void solve(), read();
const string file = "";
int main() {
  if (file != "") {
    freopen((file + ".in").c_str(), "r", stdin);
    freopen((file + ".out").c_str(), "w", stdout);
  }
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  read();
  solve();
  return 0;
}
long long n, m, q;
vector<long long> a;
vector<vector<long long> > s;
vector<long long> heavy;
vector<vector<long long> > b;
vector<vector<long long> > inter;
vector<long long> sum, cnt, coord;
void add2light(long long k, long long x) {
  for (long long i : s[k]) {
    a[i] += x;
  }
  for (long long i = 0; i < (long long)((heavy).size()); i++) {
    sum[i] += inter[k][i] * x;
  }
}
void add2heavy(long long k, long long x) { cnt[k] += x; }
long long ans4light(long long k) {
  long long ans = 0;
  for (long long i : s[k]) {
    ans += a[i];
  }
  for (long long i = 0; i < (long long)((heavy).size()); i++) {
    ans += inter[k][i] * cnt[i];
  }
  return ans;
}
long long ans4heavy(long long k) {
  long long ans = sum[k];
  for (long long i = 0; i < (long long)((heavy).size()); i++) {
    ans += inter[heavy[k]][i] * cnt[i];
  }
  return ans;
}
inline void solve() {
  coord.assign(n, -1);
  for (long long i = 0; i < m; i++) {
    if ((long long)((s[i]).size()) * (long long)((s[i]).size()) > n) {
      heavy.push_back(i);
      coord[i] = (long long)((heavy).size()) - 1;
    }
  }
  cnt.assign((long long)((heavy).size()), 0);
  b.resize((long long)((heavy).size()), vector<long long>(n, 0));
  sum.assign((long long)((heavy).size()), 0);
  for (long long i = 0; i < (long long)((heavy).size()); i++) {
    for (long long j : s[heavy[i]]) {
      b[i][j] = 1;
      sum[i] += a[j];
    }
  }
  inter.resize(m, vector<long long>((long long)((heavy).size()), 0));
  for (long long i = 0; i < m; i++) {
    for (long long x : s[i]) {
      for (long long j = 0; j < (long long)((heavy).size()); j++) {
        if (b[j][x]) {
          ++inter[i][j];
        }
      }
    }
  }
  for (long long i = 0; i < q; i++) {
    char t;
    cin >> t;
    long long k;
    cin >> k;
    --k;
    if (t == '?') {
      long long ans = 0;
      if (coord[k] == -1) {
        ans = ans4light(k);
      } else {
        ans = ans4heavy(coord[k]);
      }
      cout << ans << "\n";
    } else {
      long long x;
      cin >> x;
      if (coord[k] == -1) {
        add2light(k, x);
      } else {
        add2heavy(coord[k], x);
      }
    }
  }
}
inline void read() {
  cin >> n >> m >> q;
  a.resize(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  s.resize(m);
  for (long long i = 0; i < m; i++) {
    long long x;
    cin >> x;
    s[i].resize(x);
    for (long long j = 0; j < x; j++) {
      cin >> s[i][j];
      --s[i][j];
    }
  }
}
