//
// Created by Dmitry Gorbunov on 05/08/2017.
//

//
// Created by Dmitry Gorbunov on 01/08/2017.
//

#include <iostream>
#include <fstream>
#include <sstream>

#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>

#include <algorithm>
#include <numeric>

#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>

#define pb push_back
#define pbk pop_back
#define mp make_pair
#define fs first
#define sc second
#define all(x) (x).begin(), (x).end()
#define foreach(i, a) for (__typeof((a).begin()) i = (a).begin(); i != (a).end(); ++i)
#define len(a) ((int) (a).size())

#ifdef CUTEBMAING
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif

using namespace std;

typedef long long int64;
typedef long double ld;
typedef unsigned long long lint;

const int inf = (1 << 30) - 1;
const int64 linf = (1ll << 62) - 1;
const int N = static_cast<int>(1e5 + 100);
const int MAX_INCREASE = static_cast<int>(1e6 + 100);
const int s = 0;

int n, m, q;
int a[N], b[N], c[N];

namespace graph {
int first[N], next[N], from[N], to[N], cost[N], w[N];

inline void clear() {
  fill_n(first, n, -1);
  fill_n(next, n, -1);
}

inline void addEdge(int i, int u, int v, int c) {
  graph::from[i] = u, graph::to[i] = v, graph::cost[i] = c;
  graph::next[i] = graph::first[u];
  graph::first[u] = i;
}
}

int64 dist[N];
bool used[N];

void initialDijkstra() {
  fill_n(dist, n, linf);
  dist[s] = 0;
  set<pair<int, int>> q = { { dist[s], s } };
  while (!q.empty()) {
    int v = q.begin()->second;
    q.erase(q.begin());
    used[v] = true;
    for (int edge = graph::first[v]; edge != -1; edge = graph::next[edge]) {
      int to = graph::to[edge], cost = graph::cost[edge];
      if (dist[to] > dist[v] + cost) {
        q.erase(make_pair(dist[to], to));
        dist[to] = dist[v] + cost;
        q.insert(make_pair(dist[to], to));
      }
    }
  }
}

int total = 0;

namespace queue {
int first[MAX_INCREASE], vertex[N], next[N], cc = 0;

inline void clear() {
  fill_n(first, total, -1);
  cc = 0;
}

inline void addToQueue(int dist, int vertex) {
  queue::vertex[cc] = vertex;
  queue::next[cc] = queue::first[dist];
  queue::first[dist] = cc++;
}
}

void recalc() {
  queue::clear();
  for (int i = 0; i < m; i++) {
    if (graph::cost[i] + dist[graph::from[i]] - dist[graph::to[i]] > total) {
      graph::w[i] = inf;
    } else {
      graph::w[i] = static_cast<int>(graph::cost[i] + dist[graph::from[i]] - dist[graph::to[i]]);
    }
  }
  static int potentialDist[N];
  fill_n(potentialDist, n, inf);
  potentialDist[s] = 0;
  queue::addToQueue(potentialDist[s], s);
  for (int i = 0; i <= total; i++) {
    while (queue::first[i] != -1) {
      int start = queue::first[i];
      queue::first[i] = -1;
      for (int index = start; index != -1; index = queue::next[index]) {
        int v = queue::vertex[index];
        if (potentialDist[v] != i) {
          continue;
        }
        for (int edge = graph::first[v]; edge != -1; edge = graph::next[edge]) {
          int to = graph::to[edge], cost = graph::w[edge];
          int newDistance = potentialDist[v] + cost;
          if (newDistance <= total && potentialDist[to] > newDistance) {
            potentialDist[to] = newDistance;
            queue::addToQueue(potentialDist[to], to);
          }
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    dist[i] += potentialDist[i];
  }
  total = 0;
}

int main() {
  cin >> n >> m >> q;
  graph::clear();
  for (int i = 0; i < m; i++) {
    int u, v, c; scanf("%d%d%d", &u, &v, &c), u--, v--;
    graph::addEdge(i, u, v, c);
  }
  initialDijkstra();
  for (int i = 0; i < q; i++) {
    int t; scanf("%d", &t);
    if (t == 1) {
      int v; scanf("%d", &v); v--;
      if (total > 0) {
        recalc();
      }
      if (used[v]) {
        printf("%lld\n", dist[v]);
      } else {
        printf("-1\n");
      }
    } else if (t == 2) {
      int c; scanf("%d", &c);
      for (int j = 0; j < c; j++) {
        int edge; scanf("%d", &edge); edge--;
        ++graph::cost[edge];
      }
      total += c;
    } else {
      assert(false);
    }
  }
  return 0;
}