#include <bits/stdc++.h>
using namespace std;
struct E {
  int to, i;
};
const long long INF = 1e18;
const int N = 1e5 + 5, C = 1e5 + 5;
vector<E> g[N];
long long d[N], w[N], p[N];
bool used[N];
int n, m, q;
queue<int> qu[C];
void dijkstra_full() {
  fill(d, d + n, INF);
  d[0] = 0;
  priority_queue<pair<long long, int>, vector<pair<long long, int>>,
                 greater<pair<long long, int>>>
      q;
  q.push({d[0], 0});
  while (!q.empty()) {
    long long cd = q.top().first;
    int node = q.top().second;
    q.pop();
    if (d[node] != cd) continue;
    for (E e : g[node]) {
      if (d[e.to] > d[node] + w[e.i]) {
        d[e.to] = d[node] + w[e.i];
        q.push({d[e.to], e.to});
      }
    }
  }
}
void dijkstra_small(int c) {
  fill(d, d + n, INF);
  fill(used, used + n, false);
  d[0] = 0;
  qu[0].push(0);
  for (int i = 0; i <= c; i++) {
    while (!qu[i].empty()) {
      int node = qu[i].front();
      qu[i].pop();
      if (used[node]) continue;
      used[node] = 1;
      for (E e : g[node]) {
        if (d[e.to] > d[node] + w[e.i]) {
          d[e.to] = d[node] + w[e.i];
          if (d[e.to] <= c) qu[d[e.to]].push(e.to);
        }
      }
    }
  }
}
void update_potentials() {
  for (int i = 0; i < n; i++) {
    for (E e : g[i]) {
      w[e.i] += d[i] - d[e.to];
    }
  }
  for (int i = 0; i < n; i++) {
    p[i] = min(INF, p[i] + d[i]);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m >> q;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b >> w[i];
    a--, b--;
    g[a].push_back({b, i});
  }
  dijkstra_full();
  update_potentials();
  while (q--) {
    int type;
    cin >> type;
    if (type == 1) {
      int x;
      cin >> x;
      x--;
      if (p[x] == INF) {
        cout << "-1\n";
      } else {
        cout << p[x] << "\n";
      }
    } else {
      int x;
      cin >> x;
      for (int i = 0; i < x; i++) {
        int y;
        cin >> y;
        y--;
        w[y]++;
      }
      dijkstra_small(x);
      update_potentials();
    }
  }
  return 0;
}
