#include <bits/stdc++.h>
using namespace std;
const signed long long Infinity = 1000000001;
const long double Epsilon = 1e-9;
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  return os << "(" << p.first << "," << p.second << ")";
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& V) {
  os << "[";
  for (__typeof(V.begin()) i = V.begin(); i != V.end(); ++i)
    os << *i << (i - V.begin() + 1 == ((int)V.size()) ? "" : ",");
  os << "]\n";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& S) {
  os << "(";
  for (__typeof(S.begin()) i = S.begin(); i != S.end(); ++i)
    os << *i << (*i == *S.rbegin() ? "" : ",");
  os << ")\n";
  return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, const map<T, U>& M) {
  os << "{";
  for (__typeof(M.begin()) i = M.begin(); i != M.end(); ++i)
    os << *i << (i->first == M.rbegin()->first ? "" : ",");
  os << "}\n";
  return os;
}
const signed long long MAXN = 100100;
const signed long long SQRT = 1111;
vector<signed long long> S[MAXN];
vector<signed long long> T[MAXN];
signed long long A[MAXN];
signed long long D[MAXN];
signed long long N, M, Q;
void read_data() {
  scanf("%lld %lld %lld", &N, &M, &Q);
  for (signed long long(i) = (1); (i) <= (N); (i)++) scanf("%lld", A + i);
  for (signed long long(i) = (1); (i) <= (M); (i)++) {
    signed long long a;
    scanf("%lld", &a);
    for (signed long long(j) = (1); (j) <= (a); (j)++) {
      signed long long b;
      scanf("%lld", &b);
      S[i].push_back(b);
    }
    sort(S[i].begin(), S[i].end());
  }
}
vector<signed long long> H;
signed long long P[MAXN];
void preprocess() {
  for (signed long long(i) = (1); (i) <= (N); (i)++)
    if (((signed long long)S[i].size()) >= SQRT) {
      H.push_back(i);
      T[i].resize(N + 2);
      for (signed long long(j) = (1); (j) <= (N); (j)++) {
        signed long long r = 0;
        signed long long a = 0;
        signed long long b = 0;
        while (a < ((signed long long)S[i].size()) and
               b < ((signed long long)S[j].size())) {
          if (S[i][a] == S[j][b]) {
            ++r;
            ++a;
            ++b;
          } else if (S[i][a] < S[j][b]) {
            ++a;
          } else {
            ++b;
          }
        }
        T[i][j] = r;
      }
    }
  for (__typeof(H.begin()) i = H.begin(); i != H.end(); ++i)
    for (__typeof(S[*i].begin()) j = S[*i].begin(); j != S[*i].end(); ++j)
      P[*i] += A[*j];
}
void query() {
  char type;
  scanf("\n%c", &type);
  if (type == '?') {
    signed long long a;
    scanf("%lld", &a);
    if (((signed long long)S[a].size()) >= SQRT) {
      signed long long result = P[a];
      for (__typeof(H.begin()) i = H.begin(); i != H.end(); ++i)
        result += T[*i][a] * D[*i];
      printf("%lld\n", result);
    } else {
      signed long long result = 0;
      for (__typeof(S[a].begin()) i = S[a].begin(); i != S[a].end(); ++i)
        result += A[*i];
      for (__typeof(H.begin()) i = H.begin(); i != H.end(); ++i)
        result += T[*i][a] * D[*i];
      printf("%lld\n", result);
    }
  } else {
    signed long long a, v;
    scanf("%lld %lld", &a, &v);
    if (((signed long long)S[a].size()) >= SQRT) {
      D[a] += v;
    } else {
      for (__typeof(S[a].begin()) i = S[a].begin(); i != S[a].end(); ++i)
        A[*i] += v;
      for (__typeof(H.begin()) i = H.begin(); i != H.end(); ++i)
        P[*i] += T[*i][a] * v;
    }
  }
}
int main() {
  read_data();
  preprocess();
  for (int(i) = (1); (i) <= (Q); (i)++) query();
  return 0;
}
