#include <bits/stdc++.h>
using namespace std;
long long valor[100456], solapacion[100456][320], posheavy[100456],
    resp[100456], arrupd[100456];
vector<long long> v[100456], colaheavy;
bool light[100456], existe[100456];
void init() {
  for (int i = 0; i < 100456; ++i) {
    existe[i] = false;
  }
}
void solape(long long m) {
  long long auxcontador = 0;
  for (int i = 0; i < colaheavy.size(); ++i) {
    for (int j = 0; j < v[colaheavy[i]].size(); j++) {
      existe[v[colaheavy[i]][j]] = true;
    }
    for (int j = 0; j < m; j++) {
      auxcontador = 0;
      for (int k = 0; k < v[j].size(); k++) {
        if (existe[v[j][k]] == true) {
          auxcontador++;
        }
      }
      if (colaheavy[i] == j) auxcontador = 0;
      solapacion[j][i] = auxcontador;
    }
    for (int j = 0; j < v[colaheavy[i]].size(); j++) {
      existe[v[colaheavy[i]][j]] = false;
    }
  }
}
void updatelight(long long pos, long long val) {
  pos--;
  for (int i = 0; i < v[pos].size(); ++i) {
    valor[v[pos][i]] += val;
  }
  for (int i = 0; i < colaheavy.size(); ++i) {
    resp[colaheavy[i]] += (solapacion[pos][i]) * val;
  }
}
void updateheavy(long long pos, long long num) {
  pos--;
  resp[pos] += v[pos].size() * num;
  arrupd[pos] += num;
}
void querylight(long long num) {
  long long tot = 0;
  for (int i = 0; i < v[num].size(); ++i) {
    tot += valor[v[num][i]];
  }
  for (int i = 0; i < colaheavy.size(); ++i) {
    tot += solapacion[num][i] * arrupd[colaheavy[i]];
  }
  cout << tot << endl;
}
void queryheavy(long long num) {
  long long tot = resp[num];
  for (int i = 0; i < colaheavy.size(); ++i) {
    tot += solapacion[num][i] * arrupd[colaheavy[i]];
  }
  cout << tot << endl;
}
int main() {
  long long n, m, queries, aux, aux2, val, num;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  string txt;
  cin >> n >> m >> queries;
  init();
  for (int i = 0; i < n; ++i) {
    cin >> valor[i];
  }
  for (int i = 0; i < m; ++i) {
    cin >> aux;
    light[i] = true;
    if (aux >= sqrt(100456)) {
      posheavy[i] = colaheavy.size();
      colaheavy.push_back(i);
      light[i] = false;
    }
    resp[i] = 0;
    for (int j = 0; j < aux; j++) {
      cin >> aux2;
      aux2--;
      resp[i] += valor[aux2];
      v[i].push_back(aux2);
    }
  }
  solape(m);
  for (int i = 0; i < queries; ++i) {
    cin >> txt;
    if (txt[0] == '?') {
      cin >> val;
      val--;
      if (light[val] == true) {
        querylight(val);
      } else {
        queryheavy(val);
      }
    } else {
      cin >> num >> val;
      if (light[num - 1] == true) {
        updatelight(num, val);
      } else {
        updateheavy(num, val);
      }
    }
  }
}
