#include <bits/stdc++.h>
using namespace std;
const long long inf = (1LL << 50);
struct edge {
  int to, id;
  edge(int to = 0, int id = 0) : to(to), id(id) {}
};
int N, M, Q, c[100010], d[100010];
long long p[100010];
vector<edge> g[100010];
vector<int> cand[100010];
void recalc(int cnt) {
  int i, k;
  for (i = 1; i <= N; i++) d[i] = (1 << 30);
  for (i = 0; i <= M; i++) cand[i].clear();
  d[1] = 0;
  cand[0].push_back(1);
  for (k = 0; k <= cnt; k++) {
    for (i = 0; i < (int)cand[k].size(); i++) {
      int nod = cand[k][i];
      if (d[nod] != k) continue;
      for (edge e : g[nod]) {
        long long w = c[e.id] + p[nod] - p[e.to];
        if (w + d[nod] <= cnt && w + d[nod] < d[e.to]) {
          d[e.to] = w + d[nod];
          cand[d[e.to]].push_back(e.to);
        }
      }
    }
  }
  for (i = 1; i <= N; i++)
    if (d[i] != (1 << 30)) p[i] += d[i];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> M >> Q;
  int x, y, i;
  for (i = 1; i <= M; i++) {
    cin >> x >> y >> c[i];
    g[x].push_back(edge(y, i));
  }
  for (i = 1; i <= N; i++) p[i] = inf;
  p[1] = 0;
  set<pair<long long, int> > st;
  st.insert({0, 1});
  while (!st.empty()) {
    pair<long long, int> cr = *st.begin();
    st.erase(st.begin());
    int nod = cr.second;
    for (edge e : g[nod])
      if (p[nod] + c[e.id] < p[e.to]) {
        if (p[e.to] != inf) st.erase({p[e.to], e.to});
        p[e.to] = p[nod] + c[e.id];
        st.insert({p[e.to], e.to});
      }
  }
  while (Q--) {
    int tp;
    cin >> tp;
    if (tp == 1) {
      int v;
      cin >> v;
      cout << (p[v] == inf ? -1 : p[v]) << "\n";
    } else {
      int K, id;
      cin >> K;
      for (i = 1; i <= K; i++) {
        cin >> id;
        c[id]++;
      }
      recalc(K);
    }
  }
  return 0;
}
