#include <bits/stdc++.h>
using namespace std;
int n, m, i, qq, a[200005], b[200005], c[200005];
vector<int> g[200005];
set<pair<long long, int> > s;
long long d[200005];
void build() {
  int i, j, v, to, id;
  fill(d, d + n, 1000000000000000LL);
  d[0] = 0;
  s.insert({d[0], 0});
  for (i = 0; i < n && s.size() != 0; i++) {
    v = s.begin()->second;
    s.erase(s.begin());
    for (j = 0; j < g[v].size(); j++) {
      id = g[v][j];
      to = b[id];
      if (d[v] + c[id] < d[to]) {
        s.erase({d[to], to});
        d[to] = d[v] + c[id];
        s.insert({d[to], to});
      }
    }
  }
}
long long d1[200005];
bool used[200005];
vector<int> q[1000005];
void upd(int x) {
  int i, j, l = 0, r = 0, v, to, id;
  long long w;
  fill(d1, d1 + n, 1000000000000000LL);
  d1[0] = 0;
  fill(used, used + n, false);
  q[0].push_back(0);
  for (i = 0; i < n; i++) {
    while (l <= x) {
      for (; r < q[l].size(); r++) {
        if (!used[q[l][r]]) break;
      }
      if (r == q[l].size())
        r = 0, l++;
      else {
        v = q[l][r];
        used[v] = true;
        r++;
        break;
      }
    }
    if (l > x) break;
    for (j = 0; j < g[v].size(); j++) {
      id = g[v][j];
      to = b[id];
      w = c[id] + d[v] - d[to];
      if (d1[v] + w <= x && d1[v] + w < d1[to]) {
        d1[to] = d1[v] + w;
        q[d1[to]].push_back(to);
      }
    }
  }
  for (i = 0; i < n; i++) {
    if (d[i] != 1000000000000000LL) d[i] += d1[i];
  }
  for (i = 0; i <= x; i++) q[i].clear();
}
int main() {
  scanf("%d%d%d", &n, &m, &qq);
  for (i = 0; i < m; i++) {
    scanf("%d%d%d", &a[i], &b[i], &c[i]);
    a[i]--;
    b[i]--;
    g[a[i]].push_back(i);
  }
  build();
  while (qq--) {
    int type, x;
    scanf("%d%d", &type, &x);
    if (type == 1) {
      x--;
      if (d[x] == 1000000000000000LL)
        printf("-1\n");
      else
        printf("%I64d\n", d[x]);
    } else {
      for (i = 0; i < x; i++) {
        int ind;
        scanf("%d", &ind);
        c[--ind]++;
      }
      upd(x);
    }
  }
  return 0;
}
