#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') positive = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline void write(long long a) {
  if (a >= 10) write(a / 10);
  putchar('0' + a % 10);
}
inline void writeln(long long a) {
  if (a < 0) {
    a = -a;
    putchar('-');
  }
  write(a);
  puts("");
}
const int N = 100005, M = 100005;
const long long oo = 4e18;
int ttt, nedge, dii[M], di[M], nextt[M], ed[M], son[N], n, m, s, fff[N];
priority_queue<pair<long long, int> > q;
long long dist[N];
inline void aedge(int a, int b, int c) {
  nextt[++nedge] = son[a];
  son[a] = nedge;
  ed[nedge] = b;
  dii[nedge] = c;
}
queue<int> qq[N];
inline void duidi(int zs) {
  for (int i = 1; i <= n; i++) {
    fff[i] = 1e9;
    for (int j = son[i]; j; j = nextt[j])
      di[j] = dii[j] + dist[i] - dist[ed[j]];
  }
  qq[0].push(1);
  fff[1] = 0;
  int dq = 0, tot = 0;
  while (tot < ttt && dq <= zs && dq < n) {
    if (qq[dq].empty()) {
      dq++;
      continue;
    }
    int zs = qq[dq].front();
    qq[dq].pop();
    if (dq > fff[zs]) continue;
    tot++;
    for (int i = son[zs]; i; i = nextt[i])
      if (fff[zs] + di[i] < fff[ed[i]]) {
        fff[ed[i]] = fff[zs] + di[i];
        if (fff[ed[i]] < N) qq[fff[ed[i]]].push(ed[i]);
      }
  }
  for (int i = 0; i < N; i++)
    while (!qq[i].empty()) qq[i].pop();
  for (int i = 1; i <= n; i++) dist[i] = min(oo, dist[i] + fff[i]);
}
int main() {
  n = read();
  m = read();
  s = 1;
  int qqq = read();
  for (int i = 1; i <= n; i++) dist[i] = oo;
  while (m--) {
    int s1 = read(), s2 = read(), s3 = read();
    aedge(s1, s2, s3);
  }
  dist[s] = 0;
  q.push(make_pair(0, s));
  while (!q.empty()) {
    pair<long long, int> zs = q.top();
    q.pop();
    zs.first = -zs.first;
    if (zs.first > dist[zs.second]) continue;
    ttt++;
    for (int i = son[zs.second]; i; i = nextt[i])
      if (dist[zs.second] + dii[i] < dist[ed[i]]) {
        dist[ed[i]] = dist[zs.second] + dii[i];
        q.push(make_pair(-dist[ed[i]], ed[i]));
      }
  }
  while (qqq--) {
    int op = read();
    if (op == 1) {
      int t = read();
      writeln(dist[t] == oo ? -1 : dist[t]);
    } else {
      int ttt = read();
      for (int k = 1; k <= ttt; k++) {
        dii[read()]++;
      }
      duidi(ttt);
    }
  }
}
