#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <queue>
#define N 401000
#define int long long
typedef long long ll;
template<typename T> inline void read(T &x) {
	x = 0; char c = getchar();
	while (!isdigit(c)) c = getchar();
	while (isdigit(c)) x = x * 10 + (c ^ 48), c = getchar();
}
using namespace std;
const ll inf = 1e17;
template<typename T> inline void MIN(T &a, T b) {
	if (b < a)	a = b;
}
template<typename T> inline void MAX(T &a, T b) {
	if (a < b)	a = b;
}
int n, m;
struct edge{
	int nxt, to, val;
}e[N << 1];
int head[N], ecnt = 1;
struct node {
	int cur;
	ll val;
	node(int a = 0, ll b = 0) { cur = a, val = b; }
	inline bool operator <(const node &a) const {
		return val > a.val;
	}
};
ll dis[2][N];
priority_queue<node> q;
bool vis[N];
int h[N], htot, blong[N];
bool inmd[N << 1];
int l[N], r[N];

namespace SGT {
	int ls[N << 2], rs[N << 2], ttot, root;
	ll mn[N << 2], tag[N << 2];
	inline void pushup(int cur) {
		mn[cur] = min(mn[ls[cur]], mn[rs[cur]]);
	}
	void build(int L, int R, int &cur) {
		cur = ++ttot;
//		printf("build(%d, %d, %d)\n", L, R, cur);
		mn[cur] = inf, tag[cur] = inf + 100;
		if (L == R)	return ;
		int mid = (L + R) >> 1;
		build(L, mid, ls[cur]), build(mid + 1, R, rs[cur]);
	}
	inline void pusht(int cur, ll v) {
		if (!cur)	return ;
		MIN(mn[cur], v); MIN(tag[cur], v);
	}
	inline void pushdown(int cur) {
		if (tag[cur] < inf)	pusht(ls[cur], tag[cur]), pusht(rs[cur], tag[cur]), tag[cur] = inf + 100;
	}
	void modify(int L, int R, int l, int r, ll v, int cur) {
		if (l <= L && R <= r) return pusht(cur, v), void();
		int mid = (L + R) >> 1; pushdown(cur);
		if (l <= mid)	modify(L, mid, l, r, v, ls[cur]);
		if (r > mid)	modify(mid + 1, R, l, r, v, rs[cur]);
		pushup(cur);
	}
	inline void modify(int l, int r, ll v) {
//		printf("modify(%d, %d, %lld)\n", l, r, v);
		if (l >= r)	return ;
//		printf("modify(%d, %d, %lld)\n", l, r, v);
		modify(1, htot - 1, l, r - 1, v, root);
	}
	ll query(int L, int R, int pos, int cur) {
//		printf("query(%d, %d, %d, %d)\n", L, R, pos, cur);
		if (L == R)	return mn[cur];
		pushdown(cur);
		int mid = (L + R) >> 1;
		if (pos <= mid)	return query(L, mid, pos, ls[cur]);
		return query(mid + 1, R, pos, rs[cur]);
	}
	inline ll query(int p) {
//		printf("query(%d) = %lld\n", p, query(1, n, p, root));
		return query(1, htot - 1, p, root);
	}
}
inline void addedge(int from, int to, int val) {
	e[++ecnt] = (edge){head[from], to, val};
	head[from] = ecnt;
}

inline void dij(int s, int t) {
//	printf("dij(%d, %d)\n", s, t);
	memset(dis[t], 0x3f, sizeof(dis[t]));
	memset(vis, 0, sizeof(vis));
	while (q.size())	q.pop();
	dis[t][s] = 0; q.push(node(s, 0));
	while (q.size()) {
		int cur = q.top().cur; q.pop();
		if (vis[cur])	continue; vis[cur] = true;
//		printf("cur = %d\n", cur);
		for (int i = head[cur]; i; i = e[i].nxt) {
			int to = e[i].to; if (dis[t][to] <= dis[t][cur] + e[i].val)	continue;
			dis[t][to] = dis[t][cur] + e[i].val; q.push(node(to, dis[t][to]));
		}
	}
}

void dfs(int cur) {
	if (cur == n) return h[++htot] = cur, blong[cur] = htot, void();
	for (int i = head[cur]; i; i = e[i].nxt) {
		int to = e[i].to; if (dis[0][to] != dis[0][cur] + e[i].val)	continue;
		dfs(to); if (htot) return h[++htot] = cur, blong[cur] = htot, inmd[i] = inmd[i ^ 1] = true, void();
	}
}

void dfs_l(int cur, int yuan) {
//	printf("dfs_l(%d, %d)\n", cur, yuan);
	l[cur] = yuan;
	for (int i = head[cur]; i; i = e[i].nxt) {
		int to = e[i].to; if (inmd[i] || dis[0][to] != dis[0][cur] + e[i].val || l[to])	continue;
		dfs_l(to, yuan);
	}
}
void dfs_r(int cur, int yuan) {
//	printf("dfs_r(%d, %d)\n", cur, yuan);
	r[cur] = yuan;
	for (int i= head[cur]; i; i = e[i].nxt) {
		int to = e[i].to; if (inmd[i] || dis[1][to] != dis[1][cur] + e[i].val || r[to])	continue;
		dfs_r(to, yuan);
	}
}

signed main() {
	int q;
	read(n), read(m), read(q);
	for (int i = 1; i <= m; ++i) {
		int u, v, w; read(u), read(v), read(w);
		addedge(u, v, w), addedge(v, u, w);
	}
	dij(1, 0); dij(n, 1); dfs(1);
	for (int i = 1; htot - i + 1 >= i; ++i)
		swap(h[i], h[htot - i + 1]), swap(blong[h[i]], blong[h[htot - i + 1]]);//bug
	bool flag = false;
	for (int cur = 1; cur <= n; ++cur) if (dis[0][cur] <= inf) {
		for (int i = head[cur]; i; i = e[i].nxt) if (!inmd[i]) {
			if (dis[0][cur] + dis[1][e[i].to] + e[i].val == dis[0][n]) {//bug Rebug
				flag = true; break;
			}
		}
		if (flag)	break;
	}
	if (!flag) {
		for (int i = 1; i <= htot; ++i)//bug
			dfs_l(h[i], i), dfs_r(h[htot - i + 1], htot - i + 1);
		SGT::build(1, htot - 1, SGT::root);
		for (int cur = 1; cur <= n; ++cur) if (dis[0][cur] < inf) {
			for (int i = head[cur]; i; i = e[i].nxt) if (!inmd[i]) {
				int to = e[i].to;
//				printf("dis[0][%d] = %lld, dis[1][%d] = %lld\n", cur, dis[0][cur], to, dis[1][to]);
				SGT::modify(l[cur], r[to], dis[0][cur] + dis[1][to] + e[i].val);
			}
		}
	}
	while (q--) {
		int jzp, vl; read(jzp), read(vl);
		jzp <<= 1;
		int u = e[jzp].to, v = e[jzp | 1].to;
		if (vl < e[jzp].val) {//bug
			ll res = dis[0][n];
			MIN(res, dis[0][u] + vl + dis[1][v]);
			MIN(res, dis[0][v] + vl + dis[1][u]);
			printf("%lld\n", res);
		} else {
			if (!inmd[jzp])	printf("%lld\n", dis[0][n]);
			else {
	//			printf("dis[0][%d] = %lld, %d, blong[%d] = %d, blong[%d] = %d\n", n, dis[0][n], vl - e[jzp].val, u, blong[u], v, blong[v]);
				ll res = flag ? dis[0][n] : min(dis[0][n] + vl - e[jzp].val, SGT::query(min(blong[u], blong[v])));
				printf("%lld\n", res);
			}
		}
	}
	return 0;
}


//by jzp
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <queue>
#define N 401000
#define int long long
typedef long long ll;
template<typename T> inline void read(T &x) {
	x = 0; char c = getchar();
	while (!isdigit(c)) c = getchar();
	while (isdigit(c)) x = x * 10 + (c ^ 48), c = getchar();
}
using namespace std;
const ll inf = 1e17;
template<typename T> inline void MIN(T &a, T b) {
	if (b < a)	a = b;
}
template<typename T> inline void MAX(T &a, T b) {
	if (a < b)	a = b;
}
int n, m;
struct edge{
	int nxt, to, val;
}e[N << 1];
int head[N], ecnt = 1;
struct node {
	int cur;
	ll val;
	node(int a = 0, ll b = 0) { cur = a, val = b; }
	inline bool operator <(const node &a) const {
		return val > a.val;
	}
};
ll dis[2][N];
priority_queue<node> q;
bool vis[N];
int h[N], htot, blong[N];
bool inmd[N << 1];
int l[N], r[N];

namespace SGT {
	int ls[N << 2], rs[N << 2], ttot, root;
	ll mn[N << 2], tag[N << 2];
	inline void pushup(int cur) {
		mn[cur] = min(mn[ls[cur]], mn[rs[cur]]);
	}
	void build(int L, int R, int &cur) {
		cur = ++ttot;
		mn[cur] = inf, tag[cur] = inf + 100;
		if (L == R)	return ;
		int mid = (L + R) >> 1;
		build(L, mid, ls[cur]), build(mid + 1, R, rs[cur]);
	}
	inline void pusht(int cur, ll v) {
		if (!cur)	return ;
		MIN(mn[cur], v); MIN(tag[cur], v);
	}
	inline void pushdown(int cur) {
		if (tag[cur] < inf)	pusht(ls[cur], tag[cur]), pusht(rs[cur], tag[cur]), tag[cur] = inf + 100;
	}
	void modify(int L, int R, int l, int r, ll v, int cur) {
		if (l <= L && R <= r) return pusht(cur, v), void();
		int mid = (L + R) >> 1; pushdown(cur);
		if (l <= mid)	modify(L, mid, l, r, v, ls[cur]);
		if (r > mid)	modify(mid + 1, R, l, r, v, rs[cur]);
		pushup(cur);
	}
	inline void modify(int l, int r, ll v) {
		if (l >= r)	return ;
		modify(1, htot - 1, l, r - 1, v, root);
	}
	ll query(int L, int R, int pos, int cur) {
		if (L == R)	return mn[cur];
		pushdown(cur);
		int mid = (L + R) >> 1;
		if (pos <= mid)	return query(L, mid, pos, ls[cur]);
		return query(mid + 1, R, pos, rs[cur]);
	}
	inline ll query(int p) {
		return query(1, htot - 1, p, root);
	}
}
inline void addedge(int from, int to, int val) {
	e[++ecnt] = (edge){head[from], to, val};
	head[from] = ecnt;
}

inline void dij(int s, int t) {
	memset(dis[t], 0x3f, sizeof(dis[t]));
	memset(vis, 0, sizeof(vis));
	while (q.size())	q.pop();
	dis[t][s] = 0; q.push(node(s, 0));
	while (q.size()) {
		int cur = q.top().cur; q.pop();
		if (vis[cur])	continue; vis[cur] = true;
		for (int i = head[cur]; i; i = e[i].nxt) {
			int to = e[i].to; if (dis[t][to] <= dis[t][cur] + e[i].val)	continue;
			dis[t][to] = dis[t][cur] + e[i].val; q.push(node(to, dis[t][to]));
		}
	}
}

void dfs(int cur) {
	if (cur == n) return h[++htot] = cur, blong[cur] = htot, void();
	for (int i = head[cur]; i; i = e[i].nxt) {
		int to = e[i].to; if (dis[0][to] != dis[0][cur] + e[i].val)	continue;
		dfs(to); if (htot) return h[++htot] = cur, blong[cur] = htot, inmd[i] = inmd[i ^ 1] = true, void();
	}
}

void dfs_l(int cur, int yuan) {
	l[cur] = yuan;
	for (int i = head[cur]; i; i = e[i].nxt) {
		int to = e[i].to; if (inmd[i] || dis[0][to] != dis[0][cur] + e[i].val || l[to])	continue;
		dfs_l(to, yuan);
	}
}
void dfs_r(int cur, int yuan) {
	r[cur] = yuan;
	for (int i= head[cur]; i; i = e[i].nxt) {
		int to = e[i].to; if (inmd[i] || dis[1][to] != dis[1][cur] + e[i].val || r[to])	continue;
		dfs_r(to, yuan);
	}
}

signed main() {
	int q;
	read(n), read(m), read(q);
	for (int i = 1; i <= m; ++i) {
		int u, v, w; read(u), read(v), read(w);
		addedge(u, v, w), addedge(v, u, w);
	}
	dij(1, 0); dij(n, 1); dfs(1);
	for (int i = 1; htot - i + 1 >= i; ++i)
		swap(h[i], h[htot - i + 1]), swap(blong[h[i]], blong[h[htot - i + 1]]);//bug bug
	bool flag = false;
	for (int cur = 1; cur <= n; ++cur) if (dis[0][cur] <= inf) {
		for (int i = head[cur]; i; i = e[i].nxt) if (!inmd[i]) {
			if (dis[0][cur] + dis[1][e[i].to] + e[i].val == dis[0][n]) {//bug Rebug
				flag = true; break;
			}
		}
		if (flag)	break;
	}
	if (!flag) {
		for (int i = 1; i <= htot; ++i)//bug
			dfs_l(h[i], i), dfs_r(h[htot - i + 1], htot - i + 1);
		SGT::build(1, htot - 1, SGT::root);
		for (int cur = 1; cur <= n; ++cur) if (dis[0][cur] < inf) {
			for (int i = head[cur]; i; i = e[i].nxt) if (!inmd[i]) {
				int to = e[i].to;
				SGT::modify(l[cur], r[to], dis[0][cur] + dis[1][to] + e[i].val);
			}
		}
	}
	while (q--) {
		int jzp, vl; read(jzp), read(vl);
		jzp <<= 1;
		int u = e[jzp].to, v = e[jzp | 1].to;
		if (vl < e[jzp].val) {//bug
			ll res = dis[0][n];
			MIN(res, dis[0][u] + vl + dis[1][v]);
			MIN(res, dis[0][v] + vl + dis[1][u]);
			printf("%lld\n", res);
		} else {
			if (!inmd[jzp])	printf("%lld\n", dis[0][n]);
			else {
				ll res = flag ? dis[0][n] : min(dis[0][n] + vl - e[jzp].val, SGT::query(min(blong[u], blong[v])));
				printf("%lld\n", res);
			}
		}
	}
	return 0;
}


#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <queue>
#define N 201000
#define int long long
typedef long long ll;
template<typename T> inline void read(T &x) {
	x = 0; char c = getchar();
	while (!isdigit(c)) c = getchar();
	while (isdigit(c)) x = x * 10 + (c ^ 48), c = getchar();
}
using namespace std;
const ll inf = 1e16;
template<typename T> inline void MIN(T &a, T b) {
	if (b < a)	a = b;
}
template<typename T> inline void MAX(T &a, T b) {
	if (a < b)	a = b;
}
int n, m;
struct edge{
	int nxt, to, val;
}e[N << 1];
int head[N], ecnt = 1;
inline void addedge(int from, int to, int val) {
	e[++ecnt] = (edge){head[from], to, val};
	head[from] = ecnt;
}

struct node {
	int cur;
	ll val;
	node(int a = 0, ll b = 0) { cur = a, val = b; }
	inline bool operator <(const node &a) const {
		return val > a.val;
	}
};
ll dis[2][N];
priority_queue<node> q;
bool vis[N];
inline void dij(int s, int t) {
//	printf("dij(%d, %d)\n", s, t);
	memset(dis[t], 0x3f, sizeof(dis[t]));
	memset(vis, 0, sizeof(vis));
	while (q.size())	q.pop();
	dis[t][s] = 0; q.push(node(s, 0));
	while (q.size()) {
		int cur = q.top().cur; q.pop();
		if (vis[cur])	continue; vis[cur] = true;
//		printf("cur = %d\n", cur);
		for (int i = head[cur]; i; i = e[i].nxt) {
			int to = e[i].to; if (dis[t][to] <= dis[t][cur] + e[i].val)	continue;
			dis[t][to] = dis[t][cur] + e[i].val; q.push(node(to, dis[t][to]));
		}
	}
}

int h[N], htot, blong[N];
bool inmd[N << 1];
void dfs(int cur) {
	if (cur == n) return h[++htot] = cur, blong[cur] = htot, void();
	for (int i = head[cur]; i; i = e[i].nxt) {
		int to = e[i].to; if (dis[0][to] != dis[0][cur] + e[i].val)	continue;
		dfs(to); if (htot) return h[++htot] = cur, blong[cur] = htot, inmd[i] = inmd[i ^ 1] = true, void();
	}
}

namespace SGT {
	int ls[N << 2], rs[N << 2], ttot, root;
	ll mn[N << 2], tag[N << 2];
	inline void pushup(int cur) {
		mn[cur] = min(mn[ls[cur]], mn[rs[cur]]);
	}
	void build(int L, int R, int &cur) {
		cur = ++ttot;
//		printf("build(%d, %d, %d)\n", L, R, cur);
		mn[cur] = inf, tag[cur] = inf + 100;
		if (L == R)	return ;
		int mid = (L + R) >> 1;
		build(L, mid, ls[cur]), build(mid + 1, R, rs[cur]);
	}
	inline void pusht(int cur, ll v) {
		if (!cur)	return ;
		MIN(mn[cur], v); MIN(tag[cur], v);
	}
	inline void pushdown(int cur) {
		if (tag[cur] < inf)	pusht(ls[cur], tag[cur]), pusht(rs[cur], tag[cur]), tag[cur] = inf + 100;
	}
	void modify(int L, int R, int l, int r, ll v, int cur) {
		if (l <= L && R <= r) return pusht(cur, v), void();
		int mid = (L + R) >> 1; pushdown(cur);
		if (l <= mid)	modify(L, mid, l, r, v, ls[cur]);
		if (r > mid)	modify(mid + 1, R, l, r, v, rs[cur]);
		pushup(cur);
	}
	inline void modify(int l, int r, ll v) {
//		printf("modify(%d, %d, %lld)\n", l, r, v);
		if (l >= r)	return ;
//		printf("modify(%d, %d, %lld)\n", l, r, v);
		modify(1, htot - 1, l, r - 1, v, root);
	}
	ll query(int L, int R, int pos, int cur) {
//		printf("query(%d, %d, %d, %d)\n", L, R, pos, cur);
		if (L == R)	return mn[cur];
		pushdown(cur);
		int mid = (L + R) >> 1;
		if (pos <= mid)	return query(L, mid, pos, ls[cur]);
		return query(mid + 1, R, pos, rs[cur]);
	}
	inline ll query(int p) {
//		printf("query(%d) = %lld\n", p, query(1, n, p, root));
		return query(1, htot - 1, p, root);
	}
}

int l[N], r[N];
void dfs_l(int cur, int yuan) {
//	printf("dfs_l(%d, %d)\n", cur, yuan);
	l[cur] = yuan;
	for (int i = head[cur]; i; i = e[i].nxt) {
		int to = e[i].to; if (inmd[i] || dis[0][to] != dis[0][cur] + e[i].val || l[to])	continue;
		dfs_l(to, yuan);
	}
}
void dfs_r(int cur, int yuan) {
//	printf("dfs_r(%d, %d)\n", cur, yuan);
	r[cur] = yuan;
	for (int i= head[cur]; i; i = e[i].nxt) {
		int to = e[i].to; if (inmd[i] || dis[1][to] != dis[1][cur] + e[i].val || r[to])	continue;
		dfs_r(to, yuan);
	}
}

signed main() {
	int q;
	read(n), read(m), read(q);
	for (int i = 1; i <= m; ++i) {
		int u, v, w; read(u), read(v), read(w);
		addedge(u, v, w), addedge(v, u, w);
	}
	dij(1, 0); dij(n, 1); dfs(1);
	for (int i = 1; htot - i + 1 >= i; ++i)	swap(h[i], h[htot - i + 1]);//bug
	bool flag = false;
	for (int cur = 1; cur <= n; ++cur) if (dis[0][cur] <= inf) {
		for (int i = head[cur]; i; i = e[i].nxt) if (!inmd[i]) {
			if (dis[0][cur] + dis[1][e[i].to] + e[i].val == dis[0][n]) {//bug Rebug
				flag = true; break;
			}
		}
		if (flag)	break;
	}
	if (!flag) {
		for (int i = 1; i <= htot; ++i)//bug
			dfs_l(h[i], i), dfs_r(h[htot - i + 1], htot - i + 1);
		SGT::build(1, htot - 1, SGT::root);
		for (int cur = 1; cur <= n; ++cur) if (dis[0][cur] < inf) {
			for (int i = head[cur]; i; i = e[i].nxt) if (!inmd[i]) {
				int to = e[i].to;
//				printf("dis[0][%d] = %lld, dis[1][%d] = %lld\n", cur, dis[0][cur], to, dis[1][to]);
				SGT::modify(l[cur], r[to], dis[0][cur] + dis[1][to] + e[i].val);
			}
		}
	}
	while (q--) {
		int jzp, vl; read(jzp), read(vl);
		jzp <<= 1;
		int u = e[jzp].to, v = e[jzp | 1].to;
		if (vl < e[jzp].val) {//bug
			ll res = dis[0][n];
			MIN(res, dis[0][u] + vl + dis[1][v]);
			MIN(res, dis[0][v] + vl + dis[1][u]);
			printf("%lld\n", res);
		} else {
			if (!inmd[jzp])	printf("%lld\n", dis[0][n]);
			else {
	//			printf("dis[0][%d] = %lld, %d, blong[%d] = %d, blong[%d] = %d\n", n, dis[0][n], vl - e[jzp].val, u, blong[u], v, blong[v]);
				ll res = flag ? dis[0][n] : min(dis[0][n] + vl - e[jzp].val, SGT::query(min(blong[u], blong[v])));
				printf("%lld\n", res);
			}
		}
	}
	return 0;
}


#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <queue>
#define N 401000
#define int long long
typedef long long ll;
template<typename T> inline void read(T &x) {
	x = 0; char c = getchar();
	while (!isdigit(c)) c = getchar();
	while (isdigit(c)) x = x * 10 + (c ^ 48), c = getchar();
}
using namespace std;
const ll inf = 1e17;
template<typename T> inline void MIN(T &a, T b) {
	if (b < a)	a = b;
}
template<typename T> inline void MAX(T &a, T b) {
	if (a < b)	a = b;
}
int n, m;
struct edge{
	int nxt, to, val;
}e[N << 1];
int head[N], ecnt = 1;
struct node {
	int cur;
	ll val;
	node(int a = 0, ll b = 0) { cur = a, val = b; }
	inline bool operator <(const node &a) const {
		return val > a.val;
	}
};
ll dis[2][N];
priority_queue<node> q;
bool vis[N];
int h[N], htot, blong[N];
bool inmd[N << 1];
int l[N], r[N];

namespace SGT {
	int ls[N << 2], rs[N << 2], ttot, root;
	ll mn[N << 2], tag[N << 2];
	inline void pushup(int cur) {
		mn[cur] = min(mn[ls[cur]], mn[rs[cur]]);
	}
	void build(int L, int R, int &cur) {
		cur = ++ttot;
		mn[cur] = inf, tag[cur] = inf + 100;
		if (L == R)	return ;
		int mid = (L + R) >> 1;
		build(L, mid, ls[cur]), build(mid + 1, R, rs[cur]);
	}
	inline void pusht(int cur, ll v) {
		if (!cur)	return ;
		MIN(mn[cur], v); MIN(tag[cur], v);
	}
	inline void pushdown(int cur) {
		if (tag[cur] < inf)	pusht(ls[cur], tag[cur]), pusht(rs[cur], tag[cur]), tag[cur] = inf + 100;
	}
	void modify(int L, int R, int l, int r, ll v, int cur) {
		if (l <= L && R <= r) return pusht(cur, v), void();
		int mid = (L + R) >> 1; pushdown(cur);
		if (l <= mid)	modify(L, mid, l, r, v, ls[cur]);
		if (r > mid)	modify(mid + 1, R, l, r, v, rs[cur]);
		pushup(cur);
	}
	inline void modify(int l, int r, ll v) {
		if (l >= r)	return ;
		modify(1, htot - 1, l, r - 1, v, root);
	}
	ll query(int L, int R, int pos, int cur) {
		if (L == R)	return mn[cur];
		pushdown(cur);
		int mid = (L + R) >> 1;
		if (pos <= mid)	return query(L, mid, pos, ls[cur]);
		return query(mid + 1, R, pos, rs[cur]);
	}
	inline ll query(int p) {
		return query(1, htot - 1, p, root);
	}
}
inline void addedge(int from, int to, int val) {
	e[++ecnt] = (edge){head[from], to, val};
	head[from] = ecnt;
}

inline void dij(int s, int t) {
	memset(dis[t], 0x3f, sizeof(dis[t]));
	memset(vis, 0, sizeof(vis));
	while (q.size())	q.pop();
	dis[t][s] = 0; q.push(node(s, 0));
	while (q.size()) {
		int cur = q.top().cur; q.pop();
		if (vis[cur])	continue; vis[cur] = true;
		for (int i = head[cur]; i; i = e[i].nxt) {
			int to = e[i].to; if (dis[t][to] <= dis[t][cur] + e[i].val)	continue;
			dis[t][to] = dis[t][cur] + e[i].val; q.push(node(to, dis[t][to]));
		}
	}
}

void dfs(int cur) {
	if (cur == n) return h[++htot] = cur, blong[cur] = htot, void();
	for (int i = head[cur]; i; i = e[i].nxt) {
		int to = e[i].to; if (dis[0][to] != dis[0][cur] + e[i].val)	continue;
		dfs(to); if (htot) return h[++htot] = cur, blong[cur] = htot, inmd[i] = inmd[i ^ 1] = true, void();
	}
}

void dfs_l(int cur, int yuan) {
	l[cur] = yuan;
	for (int i = head[cur]; i; i = e[i].nxt) {
		int to = e[i].to; if (inmd[i] || dis[0][to] != dis[0][cur] + e[i].val || l[to])	continue;
		dfs_l(to, yuan);
	}
}
void dfs_r(int cur, int yuan) {
	r[cur] = yuan;
	for (int i= head[cur]; i; i = e[i].nxt) {
		int to = e[i].to; if (inmd[i] || dis[1][to] != dis[1][cur] + e[i].val || r[to])	continue;
		dfs_r(to, yuan);
	}
}

signed main() {
	int q;
	read(n), read(m), read(q);
	for (int i = 1; i <= m; ++i) {
		int u, v, w; read(u), read(v), read(w);
		addedge(u, v, w), addedge(v, u, w);
	}
	dij(1, 0);	dij(n, 1);	dfs(1);
	for (int i = 1; htot - i + 1 >= i; ++i)
		swap(h[i], h[htot - i + 1]), swap(blong[h[i]], blong[h[htot - i + 1]]);//bug bug
	bool flag = false;
	if (!flag) {
		for (int i = 1; i <= htot; ++i)//bug
			dfs_l(h[i], i), dfs_r(h[htot - i + 1], htot - i + 1);
		SGT::build(1, htot - 1, SGT::root);
		for (int cur = 1; cur <= n; ++cur) if (dis[0][cur] < inf) {
			for (int i = head[cur]; i; i = e[i].nxt) if (!inmd[i]) {
				int to = e[i].to;
				SGT::modify(l[cur], r[to], dis[0][cur] + dis[1][to] + e[i].val);
			}
		}
	}
	for (int i = 1; i <= n; ++i) if (dis[0][i] > inf || dis[1][i] > inf)	puts("qaq");
	while (q--) {
		int jzp, vl; read(jzp), read(vl);
		jzp <<= 1;
		int u = e[jzp].to, v = e[jzp | 1].to;
		if (vl < e[jzp].val) {//bug
			ll res = dis[0][n];
			MIN(res, dis[0][u] + vl + dis[1][v]);
			MIN(res, dis[0][v] + vl + dis[1][u]);
			printf("%lld\n", res);
		} else {
			if (!inmd[jzp])	printf("%lld\n", dis[0][n]);
			else {
				ll res = flag ? dis[0][n] : min(dis[0][n] + vl - e[jzp].val, SGT::query(min(blong[u], blong[v])));
				printf("%lld\n", res);
			}
		}
	}
	return 0;
}


#include<bits/stdc++.h>
#define mxn 200010
#define LL long long
using namespace std;
int n,m,Q,sl,fh,ln,l[mxn],r[mxn],ex[mxn],id[mxn],vis[mxn],pre[mxn];
LL ans,tr[mxn<<2],disS[mxn],disT[mxn];
int t,h[mxn];
int rd()
{
	sl=0;fh=1;
	char ch=getchar();
	while(ch<'0'||'9'<ch) {if(ch=='-') fh=-1; ch=getchar();}
	while('0'<=ch&&ch<='9') sl=sl*10+ch-'0',ch=getchar();
	return sl*fh;
}
struct EDGE
{
	int u,v,w;
}E[mxn];

struct edge
{
	int to,val,nxt;
}e[mxn<<1];
void add(int u,int v,int w)
{
	e[++t]=(edge){v,w,h[u]};h[u]=t;
	e[++t]=(edge){u,w,h[v]};h[v]=t;
}

struct node
{
	int v;LL dis;
	bool operator < (const node &x)const
	{
	    return dis>x.dis;
    }
};
priority_queue<node> q;
void Dij(int S,LL *dis,int flg=0)
{
	memset(dis+1,127/3,sizeof(LL)*n);
	memset(vis+1,0,sizeof(int)*n);
	q.push((node){S,dis[S]=0});
	static int u,v;
	while(!q.empty())
	{
		u=q.top().v;q.pop();
		if(!vis[u])
			for(int i=h[u];i;i=e[i].nxt)
				if(dis[v=e[i].to]>dis[u]+e[i].val)
				{
					dis[v]=dis[u]+e[i].val;
					q.push((node){v,dis[v]});
					if(flg&&!ex[v])
					{
						if(flg==1) l[v]=l[u];
						else r[v]=r[u];
					}
					else pre[v]=i;
				}
		vis[u]=1;
	}
}

#define mid ((l+r)>>1)
void build(int x,int l,int r)
{
	tr[x]=1e18;
	if(l==r) return ;
	build(x<<1,l,mid);
	build(x<<1|1,mid+1,r);
}
void init()
{
	l[1]=r[1]=0;ex[1]=1;int i,x,p=1;
	for(i=1;p!=n;++i)
	{
		x=pre[p]>>1;
		id[x]=i;
		p=e[pre[p]^1].to;
		l[p]=r[p]=i;ex[p]=1;
	}
	ln=i-1;build(1,1,ln);
}
void update(int x,int l,int r,int L,int R,LL v)
{
	if(L<=l&&r<=R) {tr[x]=min(tr[x],v); return ;}
	if(L<=mid) update(x<<1,l,mid,L,R,v);
	if(R>mid) update(x<<1|1,mid+1,r,L,R,v);
}
LL query(int x,int l,int r,int p)
{
	if(l==r) return tr[x];
	LL ret=tr[x];
	if(p<=mid) ret=min(ret,query(x<<1,l,mid,p));
	else ret=min(ret,query(x<<1|1,mid+1,r,p));
	return ret;
}

int main()
{
	n=rd();m=rd();Q=rd();t=1;int x,y,z;
	for(int i=1;i<=m;++i) x=rd(),y=rd(),z=rd(),add(x,y,z),E[i]=(EDGE){x,y,z};
	Dij(n,disT);init();Dij(1,disS,1);Dij(n,disT,2);
	for(int i=1;i<=m;++i)
		if(!id[i])
		{
			if(l[E[i].u]+1<=r[E[i].v]) update(1,1,ln,l[E[i].u]+1,r[E[i].v],disS[E[i].u]+E[i].w+disT[E[i].v]);
			if(l[E[i].v]+1<=r[E[i].u]) update(1,1,ln,l[E[i].v]+1,r[E[i].u],disS[E[i].v]+E[i].w+disT[E[i].u]);
		}
	while(Q--)
	{
		x=rd();z=rd();
		if(id[x])
		{
			ans=disS[n]-E[x].w+z;
			if(z>E[x].w) ans=min(ans,query(1,1,ln,id[x]));
		}
		else
		{
			ans=disS[n];
			if(z<E[x].w) ans=min(ans,min(disS[E[x].u]+z+disT[E[x].v],disS[E[x].v]+z+disT[E[x].u]));
		}
		printf("%lld\n",ans);
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

namespace Sweet {

template <typename T> inline void read(T &x) {
  char ch;
  int f = 1;
  while (ch = getchar(), ch > '9' || ch < '0')
    if (ch == '-') f = -1;
  x = (ch ^ 48);
  while (ch = getchar(), ch >= '0' && ch <= '9')
    x = x * 10 + (ch ^ 48);
  x *= f;
}
template <typename T> inline void write(T x) {
  static int stk[100], top = 0;
  if (x == 0) return (void)putchar('0');
  if (x < 0) x = -x, putchar('-');
  while (x) stk[++top] = x % 10, x /= 10;
  while (top) putchar(stk[top--] + '0');
}
template <typename T> inline void chkmin(T &x, const T &y) {
  x = x < y ? x : y;
}

typedef long long ll;
const int N = 2e5 + 10, M = 5e5 + 10;
const ll inf = 0x3f3f3f3f3f3f3f3f;

int tot = 1, head[N];
struct E {
  int next, to, w;
} e[M];
inline void add(int x, int y, int z) {
  e[++tot] = (E){head[x], y, z}, head[x] = tot;
  e[++tot] = (E){head[y], x, z}, head[y] = tot;
}

struct T {
  int x;
  ll dis;
  T() {}
  T(int X, ll Dis) { x = X, dis = Dis; }
  friend bool operator<(const T &a, const T &b) {
    return a.dis > b.dis;
  }
} u;
priority_queue<T> q;
int pre[N], left[N], right[N];
bool flag[N];
void Dijkstra(int s, ll *dis, short op) {
  q.push(T(s, dis[s] = 0));
  while (!q.empty()) {
    u = q.top(), q.pop();
    if (u.dis != dis[u.x]) continue;
    for (int i = head[u.x], v; i; i = e[i].next) {
      if (v = e[i].to, dis[v] > u.dis + e[i].w) {
        if (op == 0) {
          pre[v] = i;
        } else if (op == 1 && !flag[v]) {
          left[v] = left[u.x];
        } else if (op == 2 && !flag[v]) {
          right[v] = right[u.x];
        }
        q.push(T(v, dis[v] = u.dis + e[i].w));
      }
    }
  }
}

int top;
struct SegTree {
#define lson (k << 1)
#define rson (k << 1 | 1)
#define mid ((l + r) >> 1)
  ll minn[N], tag[N];
  SegTree() {
    memset(minn, 0x3f, sizeof(minn));
    memset(tag, 0x3f, sizeof(tag));
  }
  void pushdown(int k) {
    chkmin(minn[lson], tag[k]);
    chkmin(minn[rson], tag[k]);
    chkmin(tag[lson], tag[k]);
    chkmin(tag[rson], tag[k]);
    tag[k] = inf;
  }
  void pushup(int k) { minn[k] = min(minn[lson], minn[rson]); }
  void modify(int k, int L, int R, ll val, int l = 1, int r = top) {
    if (L > R) return;
    if (L <= l && r <= R) {
      chkmin(tag[k], val);
      chkmin(minn[k], val);
      return;
    }
    pushdown(k);
    if (mid >= L) modify(lson, L, R, val, l, mid);
    if (mid < R) modify(rson, L, R, val, mid + 1, r);
    pushup(k);
  }
  ll query(int k, int pos, int l = 1, int r = top) {
    if (l == r) { return minn[k]; }
    pushdown(k);
    if (mid >= pos) {
      return query(lson, pos, l, mid);
    } else {
      return query(rson, pos, mid + 1, r);
    }
  }
} Tree;

struct Edge {
  int x, y, w;
  void readIn() { read(x), read(y), read(w), add(x, y, w); }
  void copy(int &a, int &b, int &c) { a = x, b = y, c = w; }
} edge[M];
int n, m, query, id[N];
ll ans, dis[2][N];
inline void main() {
  read(n), read(m), read(query);
  for (int i = 1; i <= m; ++i) { edge[i].readIn(); }
  memset(dis[1], 0x3f, sizeof(dis[1]));
  Dijkstra(n, dis[1], 0);
  for (int i = pre[1], p = 1; pre[p]; i = pre[p]) {
    id[i >> 1] = ++top;
    right[p] = top, flag[p] = true;
    p ^= edge[i >> 1].x ^ edge[i >> 1].y;
    left[p] = top, flag[p] = true;
  }
  left[1] = 0, right[n] = top + 1;
  memset(dis, 0x3f, sizeof(dis));
  Dijkstra(1, dis[0], 1);
  Dijkstra(n, dis[1], 2);
  for (int i = 1, x, y, z; i <= m; ++i) {
    if (!id[i]) {
      edge[i].copy(x, y, z);
      Tree.modify(1, left[x] + 1, right[y] - 1,
                  dis[0][x] + z + dis[1][y]);
      Tree.modify(1, left[y] + 1, right[x] - 1,
                  dis[0][y] + z + dis[1][x]);
    }
  }
  for (int i = 1, t, w, x, y, z; i <= query; ++i) {
    read(t), read(w), edge[t].copy(x, y, z);
    ans = min(dis[0][x] + dis[1][y], dis[0][y] + dis[1][x]) + w;
    if (z >= w) {
      if (!id[t]) chkmin(ans, dis[0][n]);
    } else {
      if (!id[t]) {
        ans = dis[0][n];
      } else {
        chkmin(ans, Tree.query(1, id[t]));
      }
    }
    write(ans), putchar('\n');
  }
}

}  // namespace Sweet

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("D:\\OI\\STDquantum\\test.in", "r", stdin);
  freopen("D:\\OI\\STDquantum\\test.out", "w", stdout);
#endif
#ifndef LOCAL
  freopen("CF1163F_Indecisive_Taxi_Fee.in", "r", stdin);
  freopen("CF1163F_Indecisive_Taxi_Fee.out", "w", stdout);
#endif
#endif
  Sweet::main();
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

namespace Sweet {

template <typename T> inline void read(T &x) {
  char ch;
  int f = 1;
  while (ch = getchar(), ch > '9' || ch < '0')
    if (ch == '-') f = -1;
  x = (ch ^ 48);
  while (ch = getchar(), ch >= '0' && ch <= '9')
    x = x * 10 + (ch ^ 48);
  x *= f;
}
template <typename T> inline void write(T x) {
  static int stk[100], top = 0;
  if (x == 0) return (void)putchar('0');
  if (x < 0) x = -x, putchar('-');
  while (x) stk[++top] = x % 10, x /= 10;
  while (top) putchar(stk[top--] + '0');
}
template <typename T> inline void chkmin(T &x, const T &y) {
  x = x < y ? x : y;
}

typedef long long ll;
const int N = 2e5 + 10, M = 5e5 + 10;
const ll inf = 0x3f3f3f3f3f3f3f3f;

int tot = 1, head[N];
struct E {
  int next, to, w;
} e[M];
inline void add(int x, int y, int z) {
  e[++tot] = (E){head[x], y, z}, head[x] = tot;
  e[++tot] = (E){head[y], x, z}, head[y] = tot;
}

struct T {
  int x;
  ll dis;
  T() {}
  T(int X, ll Dis) { x = X, dis = Dis; }
  friend bool operator<(const T &a, const T &b) {
    return a.dis > b.dis;
  }
} u;
priority_queue<T> q;
int pre[N], left[N], right[N];
bool flag[N];
void Dijkstra(int s, ll *dis, short op) {
  q.push(T(s, dis[s] = 0));
  while (!q.empty()) {
    u = q.top(), q.pop();
    if (u.dis != dis[u.x]) continue;
    for (int i = head[u.x], v; i; i = e[i].next) {
      if (v = e[i].to, dis[v] > u.dis + e[i].w) {
        if (op == 0) {
          pre[v] = i;
        } else if (op == 1 && !flag[v]) {
          left[v] = left[u.x];
        } else if (op == 2 && !flag[v]) {
          right[v] = right[u.x];
        }
        q.push(T(v, dis[v] = u.dis + e[i].w));
      }
    }
  }
}

int top;
struct SegTree {
#define lson (k << 1)
#define rson (k << 1 | 1)
#define mid ((l + r) >> 1)
  ll minn[N << 2], tag[N << 2];
  SegTree() {
    memset(minn, 0x3f, sizeof(minn));
    memset(tag, 0x3f, sizeof(tag));
  }
  void pushdown(int k) {
    chkmin(minn[lson], tag[k]);
    chkmin(minn[rson], tag[k]);
    chkmin(tag[lson], tag[k]);
    chkmin(tag[rson], tag[k]);
    tag[k] = inf;
  }
  void pushup(int k) { minn[k] = min(minn[lson], minn[rson]); }
  void modify(int k, int L, int R, ll val, int l = 1, int r = top) {
    if (L > R) return;
    if (L <= l && r <= R) {
      chkmin(tag[k], val);
      chkmin(minn[k], val);
      return;
    }
    pushdown(k);
    if (mid >= L) modify(lson, L, R, val, l, mid);
    if (mid < R) modify(rson, L, R, val, mid + 1, r);
    pushup(k);
  }
  ll query(int k, int pos, int l = 1, int r = top) {
    if (l == r) { return minn[k]; }
    pushdown(k);
    if (mid >= pos) {
      return query(lson, pos, l, mid);
    } else {
      return query(rson, pos, mid + 1, r);
    }
  }
} Tree;

struct Edge {
  int x, y, w;
  void readIn() { read(x), read(y), read(w), add(x, y, w); }
  void copy(int &a, int &b, int &c) { a = x, b = y, c = w; }
} edge[M];
int n, m, query, id[N];
ll ans, dis[2][N];
inline void main() {
  read(n), read(m), read(query);
  for (int i = 1; i <= m; ++i) { edge[i].readIn(); }
  memset(dis[1], 0x3f, sizeof(dis[1]));
  Dijkstra(n, dis[1], 0);
  for (int i = pre[1], p = 1; pre[p]; i = pre[p]) {
    id[i >> 1] = ++top;
    right[p] = top, flag[p] = true;
    p ^= edge[i >> 1].x ^ edge[i >> 1].y;
    left[p] = top, flag[p] = true;
  }
  left[1] = 0, right[n] = top + 1;
  memset(dis, 0x3f, sizeof(dis));
  Dijkstra(1, dis[0], 1);
  Dijkstra(n, dis[1], 2);
  for (int i = 1, x, y, z; i <= m; ++i) {
    if (!id[i]) {
      edge[i].copy(x, y, z);
      Tree.modify(1, left[x] + 1, right[y] - 1,
                  dis[0][x] + z + dis[1][y]);
      Tree.modify(1, left[y] + 1, right[x] - 1,
                  dis[0][y] + z + dis[1][x]);
    }
  }
  for (int i = 1, t, w, x, y, z; i <= query; ++i) {
    read(t), read(w), edge[t].copy(x, y, z);
    ans = min(dis[0][x] + dis[1][y], dis[0][y] + dis[1][x]) + w;
    if (z >= w) {
      if (!id[t]) chkmin(ans, dis[0][n]);
    } else {
      if (!id[t]) {
        ans = dis[0][n];
      } else {
        chkmin(ans, Tree.query(1, id[t]));
      }
    }
    write(ans), putchar('\n');
  }
}

}  // namespace Sweet

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("D:\\OI\\STDquantum\\test.in", "r", stdin);
  freopen("D:\\OI\\STDquantum\\test.out", "w", stdout);
#endif
#ifndef LOCAL
  freopen("CF1163F_Indecisive_Taxi_Fee.in", "r", stdin);
  freopen("CF1163F_Indecisive_Taxi_Fee.out", "w", stdout);
#endif
#endif
  Sweet::main();
  return 0;
}


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define rint register int
using namespace std;
typedef long long ll;
typedef pair<ll,int>pii;
const int N=200000+10;
bool vis[N];
ll y,b[N],dis[2][N],tr[N<<2];
int n,m,Q,ant[2],bnt,cnt,x;
int head[N],head2[2][N],a[N],c[N],id[N],pre[2][N],dep[2][N],p[2][N][20];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v,next;
	ll w;
}e[N<<1],f[2][N<<1];
inline void adde(int u,int v,ll w)
{
	e[++cnt]=(node){v,head[u],w};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++ant[op]]=(node){v,head2[op][u],0};
	head2[op][u]=ant[op];
}
template<class T>inline void read(T &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int st,int op)
{
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				pre[op][v]=u;
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<20;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=19;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=19;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
void update(int L,int R,ll x,int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=min(tr[rt],x);
		return;
	}
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
ll query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	int m=(l+r)>>1;
	ll mn=1e18;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
int main()
{
	read(n),read(m),read(Q);
	memset(tr,0x3f,sizeof tr);
	memset(dis,0x3f,sizeof dis);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	dij(1,0),dij(n,1);
	for(rint i=2;i<=n;++i)
		bdde(i,pre[0][i],0),bdde(pre[0][i],i,0);
	for(rint i=1;i<n;++i)
		bdde(i,pre[1][i],1),bdde(pre[1][i],i,1);
	dfs(1,0,0),dfs(n,0,1);
	x=1;
	while(x!=n)
	{
		id[x]=++bnt;
		x=pre[1][x];
	}
	id[n]=++bnt;
	for(rint i=1;i<=m;++i)
	{
		int u=a[i],v=b[i];
		if(dis[0][u]>dis[0][v])
			swap(u,v);
		ll d=dis[0][u]+c[i]+dis[1][v];
		if(d==dis[0][n]&&(pre[0][v]==u||pre[1][u]==v))
			continue;
		int x=lca(u,n,0),y=lca(v,1,1);
		if(id[x]<id[y])
			update(id[x]+1,id[y],d,1,n,1);
	}
	for(rint i=1;i<=Q;++i)
	{
		read(x),read(y);
		int u=a[x],v=b[x];
		if(dis[0][u]>dis[0][v])
			swap(u,v);
		ll d=dis[0][u]+c[x]+dis[1][v];
		if(d==dis[0][n]&&(pre[0][v]==u||pre[1][u]==v))
		{
			ll ans=dis[0][u]+y+dis[1][v];
			if(id[u]<id[v])
				ans=min(ans,query(id[u]+1,id[v],1,n,1));
			printf("%lld\n",ans);
		}
		else
			printf("%lld\n",min(dis[0][n],dis[0][u]+y+dis[1][v]));
	}
	return 0;
}


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rint register int
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair<ll,int>pii;
const int N=200000+10;
const ll inf=1e18;
bool vis[N];
int n,m,t,x,ant,bnt,cnt,dnt[2];
int a[N],b[N],id[N],head[N],head2[2][N],pre[2][N],dep[2][N],p[2][N][20];
ll y,c[N],dis[2][N],tr[N<<2];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v;
	ll w;
	int next;
}e[N<<1],f[2][N<<2];
inline void adde(int u,int v,ll w)
{
	e[++cnt]=(node){v,w,head[u]};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++dnt[op]]=(node){v,0,head2[op][u]};
	head2[op][u]=dnt[op];
}
template<class T>inline void read(T &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int op)
{
	int st=op?n:1;
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				pre[op][v]=u;
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<20;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline bool ch(int x)
{
	return dis[0][a[x]]+c[x]+dis[1][b[x]]==dis[0][n]&&(pre[0][b[x]]==a[x]||pre[1][a[x]]==b[x]);
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=19;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=19;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
inline void pushup(int rt)
{
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
void build(int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=inf;
		return;
	}
	int m=(l+r)>>1;
	build(lson),build(rson);
	pushup(rt);
}
void update(int L,int R,ll x,int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=min(tr[rt],x);
		return;
	}
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	pushup(rt);
}
ll query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	int m=(l+r)>>1;
	ll mn=inf;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
signed main()
{
//	freopen("1.in","r",stdin);
//	freopen("1.out","w",stdout);
	read(n),read(m),read(t);
	memset(pre,-1,sizeof pre);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	for(rint i=1;i<=n;++i)
		dis[0][i]=dis[1][i]=inf;
	dij(0),dij(1);
	x=1;
	while(x!=n)
	{
		id[x]=++ant;
		x=pre[1][x];
	}
	id[n]=++ant;
	for(rint i=1;i<=n;++i)
		bdde(pre[0][i],i,0),bdde(i,pre[0][i],0);
	for(rint i=1;i<=n;++i)
		bdde(pre[1][i],i,1),bdde(i,pre[1][i],1);
	dfs(1,-1,0),dfs(n,-1,1);
	build(1,ant,1);
	for(rint i=1;i<=m;++i)
		if(!ch(i))
		{
			int z=id[lca(a[i],n,0)],w=id[lca(b[i],1,1)];
			if(z>w)
				swap(z,w);
			if(z!=w&&z&&w)
				update(z,w,dis[0][a[i]]+c[i]+dis[1][b[i]],1,ant,1);
		}
	while(t--)
	{
		read(x),read(y);
		if(ch(x))
		{
			if(y<c[x])
				printf("%lld\n",dis[0][n]-c[x]+y);
			else
			{
				ll ans=inf;
				int z=id[lca(a[x],n,0)],w=id[lca(b[x],1,1)];
				if(z>w)
					swap(z,w);
				if(z!=w&&z&&w)
					ans=query(id[z],id[w],1,ant,1);
				printf("%lld\n",min(dis[0][n]+y-c[x],ans));
			}
		}
		else
			if(y<c[x])
				printf("%lld\n",min(dis[0][n],dis[0][a[x]]+y+dis[1][b[x]]));
		else
			printf("%lld\n",dis[0][n]);
	}
	return 0;
}


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define int long long
#define rint register int
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
using namespace std;
typedef pair<int,int>pii;
const int N=200000+10,inf=1e18;
bool vis[N];
int n,m,t,x,y,bnt,cnt,dnt[2];
int a[N],b[N],c[N],id[N],head[N],head2[2][N],pre[2][N],dis[2][N],dep[2][N],p[2][N][20],tr[N<<2];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v,w,next;
}e[N<<1],f[2][N<<2];
inline void adde(int u,int v,int w)
{
	e[++cnt]=(node){v,w,head[u]};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++dnt[op]]=(node){v,0,head2[op][u]};
	head2[op][u]=dnt[op];
}
inline void read(int &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int op)
{
	int st=op?n:1;
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				pre[op][v]=u;
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<20;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline bool ch(int x)
{
	return dis[0][a[x]]+c[x]+dis[1][b[x]]==dis[0][n];
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=19;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=19;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
inline void pushup(int rt)
{
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
void build(int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=inf;
		return;
	}
	int m=(l+r)>>1;
	build(lson),build(rson);
	pushup(rt);
}
void update(int L,int R,int x,int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=min(tr[rt],x);
		return;
	}
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	pushup(rt);
}
int query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	int m=(l+r)>>1,mn=inf;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
signed main()
{
	read(n),read(m),read(t);
	memset(pre,-1,sizeof pre);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	memset(dis,0x3f,sizeof dis);
	dij(0),dij(1);
	for(rint i=1;i<=m;++i)
		if(dis[0][a[i]]>dis[0][b[i]])
			swap(a[i],b[i]);
	for(rint i=1;i<=n;++i)
		bdde(pre[0][i],i,0),bdde(i,pre[0][i],0);
	for(rint i=1;i<=n;++i)
		bdde(pre[1][i],i,1),bdde(i,pre[1][i],1);
	dfs(1,-1,0),dfs(n,-1,1);
	build(1,n,1);
	for(rint i=1;i<=m;++i)
		if(!ch(i))
		{
			x=lca(a[i],n,0),y=lca(b[i],1,1);
			update(x,y,dis[0][a[i]]+c[i]+dis[1][b[i]],1,n,1);
		}
	while(t--)
	{
		read(x),read(y);
		if(ch(x))
		{
			if(y<c[x])
				printf("%d\n",dis[0][n]-c[x]+y);
			else
				printf("%d\n",min(dis[0][n]+y-c[x],query(a[x],b[x],1,n,1)));
		}
		else
			if(y<c[x])
				printf("%d\n",min(dis[0][n],dis[0][a[x]]+y+dis[1][b[x]]));
		else
			printf("%d\n",dis[0][n]);
	}
	return 0;
}


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rint register int
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair<ll,int>pii;
const int N=200000+10;
const ll inf=1e18;
bool vis[N];
int n,m,t,x,ant,bnt,cnt,dnt[2];
int a[N],b[N],id[N],head[N],head2[2][N],pre[2][N],dep[2][N],p[2][N][20];
ll y,c[N],dis[2][N],tr[N<<2];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v;
	ll w;
	int next;
}e[N<<1],f[2][N<<2];
inline void adde(int u,int v,ll w)
{
	e[++cnt]=(node){v,w,head[u]};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++dnt[op]]=(node){v,0,head2[op][u]};
	head2[op][u]=dnt[op];
}
template<class T>inline void read(T &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int op)
{
	int st=op?n:1;
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				pre[op][v]=u;
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<20;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline bool ch(int x)
{
	return dis[0][a[x]]+c[x]+dis[1][b[x]]==dis[0][n]&&(pre[0][b[x]]==a[x]||pre[1][a[x]]==b[x]);
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=19;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=19;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
inline void pushup(int rt)
{
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
void build(int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=inf;
		return;
	}
	int m=(l+r)>>1;
	build(lson),build(rson);
	pushup(rt);
}
void update(int L,int R,ll x,int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=min(tr[rt],x);
		return;
	}
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	pushup(rt);
}
ll query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	int m=(l+r)>>1;
	ll mn=inf;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
signed main()
{
	read(n),read(m),read(t);
	memset(pre,-1,sizeof pre);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	for(rint i=1;i<=n;++i)
		dis[0][i]=dis[1][i]=inf;
	dij(0),dij(1);
	for(rint i=1;i<=m;++i)
		if(dis[0][a[i]]>dis[0][b[i]])
			swap(a[i],b[i]);
	x=1;
	while(x!=n)
	{
		id[x]=++ant;
		x=pre[1][x];
	}
	id[n]=++ant;
	for(rint i=1;i<=n;++i)
		bdde(pre[0][i],i,0),bdde(i,pre[0][i],0);
	for(rint i=1;i<=n;++i)
		bdde(pre[1][i],i,1),bdde(i,pre[1][i],1);
	dfs(1,-1,0),dfs(n,-1,1);
	build(1,n,1);
	for(rint i=1;i<=m;++i)
		if(!ch(i))
		{
			x=lca(a[i],n,0),y=lca(b[i],1,1);
			if(x!=y)
				update(id[x],id[y],dis[0][a[i]]+c[i]+dis[1][b[i]],1,n,1);
		}
	while(t--)
	{
		read(x),read(y);
		if(ch(x))
		{
			if(y<c[x])
				printf("%lld\n",dis[0][n]-c[x]+y);
			else
				printf("%lld\n",min(dis[0][n]+y-c[x],query(id[a[x]],id[b[x]],1,n,1)));
		}
		else
			if(y<c[x])
				printf("%lld\n",min(dis[0][n],dis[0][a[x]]+y+dis[1][b[x]]));
		else
			printf("%lld\n",dis[0][n]);
	}
	return 0;
}


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rint register int
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair<ll,int>pii;
const int N=200000+10;
const ll inf=1e18;
bool vis[N];
int n,m,t,x,ant,bnt,cnt,dnt[2];
int a[N],b[N],id[N],head[N],head2[2][N],pre[2][N],dep[2][N],p[2][N][20];
ll y,c[N],dis[2][N],tr[N<<2];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v;
	ll w;
	int next;
}e[N<<1],f[2][N<<2];
inline void adde(int u,int v,ll w)
{
	e[++cnt]=(node){v,w,head[u]};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++dnt[op]]=(node){v,0,head2[op][u]};
	head2[op][u]=dnt[op];
}
template<class T>inline void read(T &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int op)
{
	int st=op?n:1;
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				pre[op][v]=u;
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<20;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=19;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=19;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
inline void pushup(int rt)
{
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
void build(int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=inf;
		return;
	}
	int m=(l+r)>>1;
	build(lson),build(rson);
	pushup(rt);
}
void update(int L,int R,ll x,int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=min(tr[rt],x);
		return;
	}
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	pushup(rt);
}
ll query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	int m=(l+r)>>1;
	ll mn=inf;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
signed main()
{
	read(n),read(m),read(t);
	memset(pre,-1,sizeof pre);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	for(rint i=1;i<=n;++i)
		dis[0][i]=dis[1][i]=inf;
	dij(0),dij(1);
	x=1;
	while(x!=n)
	{
		id[x]=++ant;
		x=pre[1][x];
	}
	id[n]=++ant;
	for(rint i=1;i<=n;++i)
		bdde(pre[0][i],i,0),bdde(i,pre[0][i],0);
	for(rint i=1;i<=n;++i)
		bdde(pre[1][i],i,1),bdde(i,pre[1][i],1);
	dfs(1,-1,0),dfs(n,-1,1);
	build(1,ant,1);
	for(rint i=1;i<=m;++i)
	{
		int u=a[i],v=b[i];
		int d=min(dis[0][u]+c[i]+dis[1][v],dis[0][v]+c[i]+dis[1][u]);
		if(d==dis[0][n]&&(pre[0][v]==u||pre[1][u]==v))
			continue;
		int xu=lca(u,n,0),yu=lca(u,1,1),xv=lca(v,n,0),yv=lca(v,1,1);
		xu=id[xu],yu=id[pre[0][yu]];
		xv=id[xv],yv=id[pre[0][yv]];
		ll disuv=dis[0][u]+c[i]+dis[1][v];
		ll disvu=dis[0][v]+c[i]+dis[1][u];
		if(xu<=yv&&xu&&yv&&xu<=ant&&yv<=ant)
			update(xu,yv,disuv,1,ant,1);
		if(xv<=yu&&xv&&yu&&xv<=ant&&yu<=ant)
			update(xv,yu,disvu,1,ant,1);
	}
	while(t--)
	{
		read(x),read(y);
		int u=a[x],v=b[x],d=min(dis[0][u]+c[x]+dis[1][v],dis[0][v]+c[x]+dis[1][u]);
		if(d==dis[0][n]&&(pre[0][v]==u||pre[1][u]==v))
		{
			if(y<c[x])
				printf("%lld\n",dis[0][n]-c[x]+y);
			else
				printf("%lld\n",min(dis[0][n]+y-c[x],query(id[u],id[v],1,ant,1)));
		}
		else
			if(y<c[x])
				printf("%lld\n",min(dis[0][n],dis[0][u]+y+dis[1][v]));
		else
			printf("%lld\n",dis[0][n]);
	}
	return 0;
}


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define rint register int
using namespace std;
typedef long long ll;
typedef pair<ll,int>pii;
const int N=200000+10;
bool vis[N],lazy[N<<2];
ll y,b[N],dis[2][N],tr[N<<2];
int n,m,Q,ant[2],bnt,cnt,x;
int head[N],head2[2][N],a[N],c[N],id[N],pre[2][N],dep[2][N],p[2][N][20];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v,next;
	ll w;
}e[N<<1],f[2][N<<1];
inline void adde(int u,int v,ll w)
{
	e[++cnt]=(node){v,head[u],w};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++ant[op]]=(node){v,head2[op][u],0};
	head2[op][u]=ant[op];
}
template<class T>inline void read(T &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int st,int op)
{
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				pre[op][v]=u;
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<20;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=19;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=19;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
inline void pushdown(int rt)
{
	lazy[rt<<1]=lazy[rt<<1|1]=1;
	tr[rt<<1]=min(tr[rt<<1],tr[rt]);
	tr[rt<<1|1]=min(tr[rt<<1|1],tr[rt]);
	lazy[rt]=0;
}
void update(int L,int R,ll x,int l,int r,int rt)
{
	if(L<=l&&r<=R)
	{
		if(tr[rt]>x)
		{
			lazy[rt]=1;
			tr[rt]=min(tr[rt],x);
		}
		return;
	}
	if(lazy[rt])
		pushdown(rt);
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
ll query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	if(lazy[rt])
		pushdown(rt);
	int m=(l+r)>>1;
	ll mn=1e18;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
int main()
{
	read(n),read(m),read(Q);
	memset(tr,0x3f,sizeof tr);
	memset(dis,0x3f,sizeof dis);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	dij(1,0),dij(n,1);
	for(rint i=2;i<=n;++i)
		bdde(i,pre[0][i],0),bdde(pre[0][i],i,0);
	for(rint i=1;i<n;++i)
		bdde(i,pre[1][i],1),bdde(pre[1][i],i,1);
	dfs(1,0,0),dfs(n,0,1);
	x=1;
	while(x!=n)
	{
		id[x]=++bnt;
		x=pre[1][x];
	}
	id[n]=++bnt;
	for(rint i=1;i<=m;++i)
	{
		int u=a[i],v=b[i];
		if(dis[0][u]>dis[0][v])
			swap(u,v);
		ll d=dis[0][u]+c[i]+dis[1][v];
		if(d==dis[0][n]&&(pre[0][v]==u||pre[1][u]==v))
			continue;
		int x=lca(u,n,0),y=lca(v,1,1);
		if(id[x]<id[y])
			update(id[x]+1,id[y],d,1,n,1);
	}
	for(rint i=1;i<=Q;++i)
	{
		read(x),read(y);
		int u=a[x],v=b[x];
		if(dis[0][u]>dis[0][v])
			swap(u,v);
		ll d=dis[0][u]+c[x]+dis[1][v];
		if(d==dis[0][n]&&(pre[0][v]==u||pre[1][u]==v))
		{
			ll ans=dis[0][u]+y+dis[1][v];
			if(id[u]<id[v])
				ans=min(ans,query(id[u]+1,id[v],1,n,1));
			printf("%lld\n",ans);
		}
		else
			printf("%lld\n",min(dis[0][n],dis[0][u]+y+dis[1][v]));
	}
	return 0;
}


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define rint register int
using namespace std;
typedef long long ll;
typedef pair<ll,int>pii;
const int N=200000+10;
bool vis[N];
ll y,b[N],dis[2][N],tr[N<<2];
int n,m,Q,ant[2],bnt,cnt,x;
int head[N],head2[2][N],a[N],c[N],id[N],pre[2][N],dep[2][N],p[2][N][20];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v,next;
	ll w;
}e[N<<1],f[2][N<<1];
inline void adde(int u,int v,ll w)
{
	e[++cnt]=(node){v,head[u],w};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++ant[op]]=(node){v,head2[op][u],0};
	head2[op][u]=ant[op];
}
template<class T>inline void read(T &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int st,int op)
{
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				pre[op][v]=u;
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<20;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=19;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=19;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
void update(int L,int R,ll x,int l,int r,int rt)
{
	if(L<=l&&r<=R)
	{
		tr[rt]=min(tr[rt],x);
		return;
	}
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
ll query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	int m=(l+r)>>1;
	ll mn=1e18;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
int main()
{
	read(n),read(m),read(Q);
	memset(tr,0x3f,sizeof tr);
	memset(dis,0x3f,sizeof dis);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	dij(1,0),dij(n,1);
	for(rint i=2;i<=n;++i)
		bdde(i,pre[0][i],0),bdde(pre[0][i],i,0);
	for(rint i=1;i<n;++i)
		bdde(i,pre[1][i],1),bdde(pre[1][i],i,1);
	dfs(1,0,0),dfs(n,0,1);
	x=1;
	while(x!=n)
	{
		id[x]=++bnt;
		x=pre[1][x];
	}
	id[n]=++bnt;
	for(rint i=1;i<=m;++i)
	{
		int u=a[i],v=b[i];
		if(dis[0][u]>dis[0][v])
			swap(u,v);
		ll d=dis[0][u]+c[i]+dis[1][v];
		if(d==dis[0][n]&&(pre[0][v]==u||pre[1][u]==v))
			continue;
		int x=lca(u,n,0),y=lca(v,1,1);
		if(id[x]<=id[y])
			update(id[x],id[y],d,1,n,1);
	}
	for(rint i=1;i<=Q;++i)
	{
		read(x),read(y);
		int u=a[x],v=b[x];
		if(dis[0][u]>dis[0][v])
			swap(u,v);
		ll d=dis[0][u]+c[x]+dis[1][v];
		if(d==dis[0][n]&&(pre[0][v]==u||pre[1][u]==v))
		{
			ll ans=dis[0][u]+y+dis[1][v];
			if(id[u]<=id[v])
				ans=min(ans,query(id[u],id[v],1,n,1));
			printf("%lld\n",ans);
		}
		else
			printf("%lld\n",min(dis[0][n],dis[0][u]+y+dis[1][v]));
	}
	return 0;
}


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rint register int
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair<ll,int>pii;
const int N=200000+10;
const ll inf=1e18;
bool vis[N];
int n,m,t,x,ant,bnt,cnt,dnt[2];
int a[N],b[N],id[N],head[N],head2[2][N],pre[2][N],dep[2][N],p[2][N][20];
ll y,c[N],dis[2][N],tr[N<<2];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v;
	ll w;
	int next;
}e[N<<1],f[2][N<<2];
inline void adde(int u,int v,ll w)
{
	e[++cnt]=(node){v,w,head[u]};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++dnt[op]]=(node){v,0,head2[op][u]};
	head2[op][u]=dnt[op];
}
template<class T>inline void read(T &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int op)
{
	int st=op?n:1;
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				if(op)
					pre[op][min(v,u)]=max(v,u);
				else
					pre[op][max(v,u)]=min(v,u);
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<20;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline bool ch(int x)
{
	return dis[0][a[x]]+c[x]+dis[1][b[x]]==dis[0][n]&&(pre[0][b[x]]==a[x]||pre[1][a[x]]==b[x]);
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=19;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=19;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
inline void pushup(int rt)
{
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
void build(int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=inf;
		return;
	}
	int m=(l+r)>>1;
	build(lson),build(rson);
	pushup(rt);
}
void update(int L,int R,ll x,int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=min(tr[rt],x);
		return;
	}
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	pushup(rt);
}
ll query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	int m=(l+r)>>1;
	ll mn=inf;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
signed main()
{
	read(n),read(m),read(t);
	memset(pre,-1,sizeof pre);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	for(rint i=1;i<=n;++i)
		dis[0][i]=dis[1][i]=inf;
	dij(0),dij(1);
	for(rint i=1;i<=m;++i)
		if(dis[0][a[i]]>dis[0][b[i]])
			swap(a[i],b[i]);
	x=1;
	while(x!=n)
	{
		id[x]=++ant;
		x=pre[1][x];
	}
	id[n]=++ant;
	for(rint i=1;i<=n;++i)
		bdde(pre[0][i],i,0),bdde(i,pre[0][i],0);
	for(rint i=1;i<=n;++i)
		bdde(pre[1][i],i,1),bdde(i,pre[1][i],1);
	dfs(1,-1,0),dfs(n,-1,1);
	build(1,ant,1);
	for(rint i=1;i<=m;++i)
		if(!ch(i))
		{
			x=id[lca(a[i],n,0)],y=id[lca(b[i],1,1)];
			if(x!=y)
				update(x,y,dis[0][a[i]]+c[i]+dis[1][b[i]],1,ant,1);
		}
	while(t--)
	{
		read(x),read(y);
		if(ch(x))
		{
			if(y<c[x])
				printf("%lld\n",dis[0][n]-c[x]+y);
			else
				printf("%lld\n",min(dis[0][n]+y-c[x],query(id[a[x]],id[b[x]],1,ant,1)));
		}
		else
			if(y<c[x])
				printf("%lld\n",min(dis[0][n],dis[0][a[x]]+y+dis[1][b[x]]));
		else
			printf("%lld\n",dis[0][n]);
	}
	return 0;
}


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define rint register int
using namespace std;
typedef long long ll;
typedef pair<ll,int>pii;
const int N=200000+10;
bool vis[N],lazy[N<<2];
ll y,b[N],dis[2][N],tr[N<<2];
int n,m,Q,ant[2],bnt,cnt,x;
int head[N],head2[2][N],a[N],c[N],id[N],pre[2][N],dep[2][N],p[2][N][20];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v,next;
	ll w;
}e[N<<1],f[2][N<<1];
inline void adde(int u,int v,ll w)
{
	e[++cnt]=(node){v,head[u],w};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++ant[op]]=(node){v,head2[op][u],0};
	head2[op][u]=ant[op];
}
template<class T>inline void read(T &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int st,int op)
{
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				pre[op][v]=u;
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<20;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=19;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=19;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
inline void pushdown(int rt)
{
	lazy[rt<<1]=lazy[rt<<1|1]=1;
	tr[rt<<1]=min(tr[rt<<1],tr[rt]);
	tr[rt<<1|1]=min(tr[rt<<1|1],tr[rt]);
	lazy[rt]=0;
}
void update(int L,int R,ll x,int l,int r,int rt)
{
	if(L<=l&&r<=R)
	{
		lazy[rt]=1;
		tr[rt]=min(tr[rt],x);
		return;
	}
	if(lazy[rt])
		pushdown(rt);
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
ll query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	if(lazy[rt])
		pushdown(rt);
	int m=(l+r)>>1;
	ll mn=1e18;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
int main()
{
	read(n),read(m),read(Q);
	memset(tr,0x3f,sizeof tr);
	memset(dis,0x3f,sizeof dis);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	dij(1,0),dij(n,1);
	for(rint i=2;i<=n;++i)
		bdde(i,pre[0][i],0),bdde(pre[0][i],i,0);
	for(rint i=1;i<n;++i)
		bdde(i,pre[1][i],1),bdde(pre[1][i],i,1);
	dfs(1,0,0),dfs(n,0,1);
	x=1;
	while(x!=n)
	{
		id[x]=++bnt;
		x=pre[1][x];
	}
	id[n]=++bnt;
	for(rint i=1;i<=m;++i)
	{
		int u=a[i],v=b[i];
		if(dis[0][u]>dis[0][v])
			swap(u,v);
		ll d=dis[0][u]+c[i]+dis[1][v];
		if(d==dis[0][n]&&(pre[0][v]==u||pre[1][u]==v))
			continue;
		int x=lca(u,n,0),y=lca(v,1,1);
		if(id[x]<id[y])
			update(id[x]+1,id[y],d,1,n,1);
	}
	for(rint i=1;i<=Q;++i)
	{
		read(x),read(y);
		int u=a[x],v=b[x];
		if(dis[0][u]>dis[0][v])
			swap(u,v);
		ll d=dis[0][u]+c[x]+dis[1][v];
		if(d==dis[0][n]&&(pre[0][v]==u||pre[1][u]==v))
		{
			ll ans=dis[0][u]+y+dis[1][v];
			if(id[u]<id[v])
				ans=min(ans,query(id[u]+1,id[v],1,n,1));
			printf("%lld\n",ans);
		}
		else
			printf("%lld\n",min(dis[0][n],dis[0][u]+y+dis[1][v]));
	}
	return 0;
}


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define rint register int
using namespace std;
typedef long long ll;
typedef pair<ll,int>pii;
const int N=200000+10;
bool vis[N];
ll y,b[N],dis[2][N],tr[N<<2];
int n,m,Q,ant[2],bnt,cnt,x;
int head[N],head2[2][N],a[N],c[N],id[N],pre[2][N],dep[2][N],p[2][N][20];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v,next;
	ll w;
}e[N<<1],f[2][N<<1];
inline void adde(int u,int v,ll w)
{
	e[++cnt]=(node){v,head[u],w};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++ant[op]]=(node){v,head2[op][u],0};
	head2[op][u]=ant[op];
}
template<class T>inline void read(T &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int st,int op)
{
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				pre[op][v]=u;
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<20;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=19;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=19;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
void update(int L,int R,ll x,int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=min(tr[rt],x);
		return;
	}
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
ll query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	int m=(l+r)>>1;
	ll mn=1e18;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
int main()
{
	read(n),read(m),read(Q);
	memset(tr,0x3f,sizeof tr);
	memset(dis,0x3f,sizeof dis);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	dij(1,0),dij(n,1);
	for(rint i=2;i<=n;++i)
		bdde(i,pre[0][i],0),bdde(pre[0][i],i,0);
	for(rint i=1;i<n;++i)
		bdde(i,pre[1][i],1),bdde(pre[1][i],i,1);
	dfs(1,0,0),dfs(n,0,1);
	x=1;
	while(x!=n)
	{
		id[x]=++bnt;
		x=pre[1][x];
	}
	id[n]=++bnt;
	for(rint i=1;i<=m;++i)
	{
		int u=a[i],v=b[i];
		if(dis[0][u]>dis[0][v])
			swap(u,v);
		ll d=dis[0][u]+c[i]+dis[1][v];
		if(d==dis[0][n]&&(pre[0][v]==u||pre[1][u]==v))
			continue;
		int x=lca(u,n,0),y=lca(v,1,1);
		if(id[x]<id[y])
			update(id[x]+1,id[y],d,1,bnt,1);
	}
	for(rint i=1;i<=Q;++i)
	{
		read(x),read(y);
		int u=a[x],v=b[x];
		if(dis[0][u]>dis[0][v])
			swap(u,v);
		ll d=dis[0][u]+c[x]+dis[1][v];
		if(d==dis[0][n]&&(pre[0][v]==u||pre[1][u]==v))
		{
			ll ans=dis[0][u]+y+dis[1][v];
			if(id[u]<id[v])
				ans=min(ans,query(id[u]+1,id[v],1,bnt,1));
			printf("%lld\n",ans);
		}
		else
			printf("%lld\n",min(dis[0][n],dis[0][u]+y+dis[1][v]));
	}
	return 0;
}
?


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define int long long
#define rint register int
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
using namespace std;
typedef pair<int,int>pii;
const int N=200000+10,inf=1e18;
bool vis[N];
int n,m,t,x,y,bnt,cnt,dnt[2];
int a[N],b[N],c[N],id[N],head[N],head2[2][N],pre[2][N],dis[2][N],dep[2][N],p[2][N][20],tr[N<<2];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v,w,next;
}e[N<<1],f[2][N<<2];
inline void adde(int u,int v,int w)
{
	e[++cnt]=(node){v,w,head[u]};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++dnt[op]]=(node){v,0,head2[op][u]};
	head2[op][u]=dnt[op];
}
inline void read(int &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int op)
{
	int st=op?n:1;
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				pre[op][v]=u;
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<20;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline bool ch(int x)
{
	return dis[0][a[x]]+c[x]+dis[1][b[x]]==dis[0][n]&&(pre[0][b[x]]==a[x]||pre[1][a[x]]==b[x]);
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=19;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=19;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
inline void pushup(int rt)
{
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
void build(int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=inf;
		return;
	}
	int m=(l+r)>>1;
	build(lson),build(rson);
	pushup(rt);
}
void update(int L,int R,int x,int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=min(tr[rt],x);
		return;
	}
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	pushup(rt);
}
int query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	int m=(l+r)>>1,mn=inf;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
signed main()
{
	read(n),read(m),read(t);
	memset(pre,-1,sizeof pre);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	memset(dis,0x3f,sizeof dis);
	dij(0),dij(1);
	for(rint i=1;i<=m;++i)
		if(dis[0][a[i]]>dis[0][b[i]])
			swap(a[i],b[i]);
	for(rint i=1;i<=n;++i)
		bdde(pre[0][i],i,0),bdde(i,pre[0][i],0);
	for(rint i=1;i<=n;++i)
		bdde(pre[1][i],i,1),bdde(i,pre[1][i],1);
	dfs(1,-1,0),dfs(n,-1,1);
	build(1,n,1);
	for(rint i=1;i<=m;++i)
		if(!ch(i))
		{
			x=lca(a[i],n,0),y=lca(b[i],1,1);
			update(x,y,dis[0][a[i]]+c[i]+dis[1][b[i]],1,n,1);
		}
	while(t--)
	{
		read(x),read(y);
		if(ch(x))
		{
			if(y<c[x])
				printf("%lld\n",dis[0][n]-c[x]+y);
			else
				printf("%lld\n",min(dis[0][n]+y-c[x],query(a[x],b[x],1,n,1)));
		}
		else
			if(y<c[x])
				printf("%lld\n",min(dis[0][n],dis[0][a[x]]+y+dis[1][b[x]]));
		else
			printf("%lld\n",dis[0][n]);
	}
	return 0;
}


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define rint register int
using namespace std;
typedef long long ll;
typedef pair<ll,int>pii;
const int N=200000+10;
bool vis[N];
ll y,b[N],dis[2][N],tr[N<<2];
int n,m,Q,ant[2],bnt,cnt,x;
int head[N],head2[2][N],a[N],c[N],id[N],pre[2][N],dep[2][N],p[2][N][20];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v,next;
	ll w;
}e[N<<1],f[2][N<<1];
inline void adde(int u,int v,ll w)
{
	e[++cnt]=(node){v,head[u],w};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++ant[op]]=(node){v,head2[op][u],0};
	head2[op][u]=ant[op];
}
template<class T>inline void read(T &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int st,int op)
{
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				pre[op][v]=u;
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<20;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=19;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=19;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
void update(int L,int R,ll x,int l,int r,int rt)
{
	if(L<=l&&r<=R)
	{
		tr[rt]=min(tr[rt],x);
		return;
	}
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
ll query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	int m=(l+r)>>1;
	ll mn=1e18;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
int main()
{
	read(n),read(m),read(Q);
	memset(tr,0x3f,sizeof tr);
	memset(dis,0x3f,sizeof dis);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	dij(1,0),dij(n,1);
	for(rint i=2;i<=n;++i)
		bdde(i,pre[0][i],0),bdde(pre[0][i],i,0);
	for(rint i=1;i<n;++i)
		bdde(i,pre[1][i],1),bdde(pre[1][i],i,1);
	dfs(1,0,0),dfs(n,0,1);
	int x=1;
	while(x!=n)
	{
		id[x]=++bnt;
		x=pre[1][x];
	}
	id[n]=++bnt;
	for(rint i=1;i<=m;++i)
	{
		int u=a[i],v=b[i];
		if(dis[0][u]>dis[0][v])
			swap(u,v);
		ll d=dis[0][u]+c[i]+dis[1][v];
		if(d==dis[0][n]&&(pre[0][v]==u||pre[1][u]==v))
			continue;
		int x=lca(u,n,0),y=lca(v,1,1);
		update(id[x]+1,id[y],d,1,n,1);
	}
	for(rint i=1;i<=Q;++i)
	{
		read(x),read(y);
		int u=a[x],v=b[x];
		if(dis[0][u]>dis[0][v])
			swap(u,v);
		ll d=dis[0][u]+c[x]+dis[1][v];
		if(d==dis[0][n]&&(pre[0][v]==u||pre[1][u]==v))
			printf("%lld\n",min(dis[0][u]+y+dis[1][v],query(id[u]+1,id[v],1,n,1)));
		else
			printf("%lld\n",min(dis[0][n],dis[0][u]+y+dis[1][v]));
	}
	return 0;
}


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define int long long
#define rint register int
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
using namespace std;
typedef pair<int,int>pii;
const int N=200000+10,inf=1e18;
bool vis[N];
int n,m,t,x,y,bnt,cnt,dnt[2];
int a[N],b[N],c[N],id[N],head[N],head2[2][N],pre[2][N],dis[2][N],dep[2][N],p[2][N][20],tr[N<<2];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v,w,next;
}e[N<<1],f[2][N<<2];
inline void adde(int u,int v,int w)
{
	e[++cnt]=(node){v,w,head[u]};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++dnt[op]]=(node){v,0,head2[op][u]};
	head2[op][u]=dnt[op];
}
inline void read(int &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int op)
{
	int st=op?n:1;
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				pre[op][v]=u;
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<20;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline bool ch(int x)
{
	return dis[0][a[x]]+c[x]+dis[1][b[x]]==dis[0][n]&&(pre[0][b[x]]==a[x]||pre[1][a[x]]==b[x]);
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=19;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=19;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
inline void pushup(int rt)
{
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
void build(int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=inf;
		return;
	}
	int m=(l+r)>>1;
	build(lson),build(rson);
	pushup(rt);
}
void update(int L,int R,int x,int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=min(tr[rt],x);
		return;
	}
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	pushup(rt);
}
int query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	int m=(l+r)>>1,mn=inf;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
signed main()
{
//	freopen("1.in","r",stdin);
//	freopen("1.out","w",stdout);
	read(n),read(m),read(t);
	memset(pre,-1,sizeof pre);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	memset(dis,0x3f,sizeof dis);
	dij(0),dij(1);
	for(rint i=1;i<=m;++i)
		if(dis[0][a[i]]>dis[0][b[i]])
			swap(a[i],b[i]);
	for(rint i=1;i<=n;++i)
		bdde(pre[0][i],i,0),bdde(i,pre[0][i],0);
	for(rint i=1;i<=n;++i)
		bdde(pre[1][i],i,1),bdde(i,pre[1][i],1);
	dfs(1,-1,0),dfs(n,-1,1);
	build(1,n,1);
	for(rint i=1;i<=m;++i)
		if(!ch(i))
		{
			x=lca(a[i],n,0),y=lca(b[i],1,1);
//			cout<<x<<' '<<y<<' '<<dis[0][a[i]]+c[i]+dis[1][b[i]]<<endl;
if(x!=y)
			update(x,y,dis[0][a[i]]+c[i]+dis[1][b[i]],1,n,1);
		}
//	for(rint i=1;i<=n*2;++i)
//		cout<<tr[i]<<' ';cout<<endl;
	while(t--)
	{
		read(x),read(y);
		if(ch(x))
		{
			if(y<c[x])
				printf("%lld\n",dis[0][n]-c[x]+y);
			else
				printf("%lld\n",min(dis[0][n]+y-c[x],query(a[x],b[x],1,n,1)));

		}
		else
			if(y<c[x])
				printf("%lld\n",min(dis[0][n],dis[0][a[x]]+y+dis[1][b[x]]));
		else
			printf("%lld\n",dis[0][n]);
	}
	return 0;
}


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rint register int
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair<ll,int>pii;
const int N=200000+10;
const ll inf=1e18;
bool vis[N];
int n,m,t,x,ant,bnt,cnt,dnt[2];
int a[N],b[N],id[N],head[N],head2[2][N],pre[2][N],dep[2][N],p[2][N][20];
ll y,c[N],dis[2][N],tr[N<<2];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v;
	ll w;
	int next;
}e[N<<1],f[2][N<<2];
inline void adde(int u,int v,ll w)
{
	e[++cnt]=(node){v,w,head[u]};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++dnt[op]]=(node){v,0,head2[op][u]};
	head2[op][u]=dnt[op];
}
template<class T>inline void read(T &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int op)
{
	int st=op?n:1;
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				pre[op][v]=u;
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<20;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline bool ch(int x)
{
	if(!pre[0][b[x]]==a[x]&&!pre[1][a[x]]==b[x])
		return false;
	if(dis[0][a[x]]<dis[0][b[x]])
		return dis[0][a[x]]+c[x]+dis[1][b[x]]==dis[0][n];
	return dis[0][b[x]]+c[x]+dis[1][a[x]]==dis[0][n];
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=19;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=19;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
inline void pushup(int rt)
{
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
void build(int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=inf;
		return;
	}
	int m=(l+r)>>1;
	build(lson),build(rson);
	pushup(rt);
}
void update(int L,int R,ll x,int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=min(tr[rt],x);
		return;
	}
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	pushup(rt);
}
ll query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	int m=(l+r)>>1;
	ll mn=inf;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
signed main()
{
//	freopen("1.in","r",stdin);
//	freopen("1.out","w",stdout);
	read(n),read(m),read(t);
	memset(pre,-1,sizeof pre);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	for(rint i=1;i<=n;++i)
		dis[0][i]=dis[1][i]=inf;
	dij(0),dij(1);
	x=1;
	while(x!=n)
	{
		id[x]=++ant;
		x=pre[1][x];
	}
	id[n]=++ant;
	for(rint i=1;i<=n;++i)
		bdde(pre[0][i],i,0),bdde(i,pre[0][i],0);
	for(rint i=1;i<=n;++i)
		bdde(pre[1][i],i,1),bdde(i,pre[1][i],1);
	dfs(1,-1,0),dfs(n,-1,1);
	build(1,ant,1);
	for(rint i=1;i<=m;++i)
		if(!ch(i))
		{
			int z=id[lca(a[i],n,0)],w=id[lca(b[i],1,1)];
			if(z>w)
				swap(z,w);
			if(z!=w&&z&&w)
				update(z,w,dis[0][a[i]]+c[i]+dis[1][b[i]],1,ant,1);
		}
	while(t--)
	{
		read(x),read(y);
		if(ch(x))
		{
			if(y<c[x])
				printf("%lld\n",dis[0][n]-c[x]+y);
			else
			{
				ll ans=inf;
				int z=id[a[x]],w=id[b[x]];
				if(z>w)
					swap(z,w);
				if(z!=w&&z&&w)
					ans=query(id[z],id[w],1,ant,1);
				printf("%lld\n",min(dis[0][n]+y-c[x],ans));
			}
		}
		else
			if(y<c[x])
				printf("%lld\n",min(dis[0][n],dis[0][a[x]]+y+dis[1][b[x]]));
		else
			printf("%lld\n",dis[0][n]);
	}
	return 0;
}


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rint register int
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair<int,int>pii;
const int N=200000+10,inf=0x3f3f3f3f;
bool vis[N];
int n,m,t,x,y,bnt,cnt,dnt[2];
int a[N],b[N],c[N],id[N],head[N],head2[2][N],pre[2][N],dis[2][N],dep[2][N],p[2][N][20],tr[N<<2];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v,w,next;
}e[N<<1],f[2][N<<2];
inline void adde(int u,int v,int w)
{
	e[++cnt]=(node){v,w,head[u]};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++dnt[op]]=(node){v,0,head2[op][u]};
	head2[op][u]=dnt[op];
}
inline void read(int &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int op)
{
	int st=op?n:1;
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				pre[op][v]=u;
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<20;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline bool ch(int x)
{
	return dis[0][a[x]]+c[x]+dis[1][b[x]]==dis[0][n];
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=19;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=19;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
inline void pushup(int rt)
{
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
void build(int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=inf;
		return;
	}
	int m=(l+r)>>1;
	build(lson),build(rson);
	pushup(rt);
}
void update(int L,int R,int x,int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=min(tr[rt],x);
		return;
	}
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	pushup(rt);
}
int query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	int m=(l+r)>>1,mn=inf;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
int main()
{
	read(n),read(m),read(t);
	memset(pre,-1,sizeof pre);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	memset(dis,0x3f,sizeof dis);
	dij(0),dij(1);
	for(rint i=1;i<=m;++i)
		if(dis[0][a[i]]>dis[0][b[i]])
			swap(a[i],b[i]);
	for(rint i=1;i<=n;++i)
		bdde(pre[0][i],i,0),bdde(i,pre[0][i],0);
	for(rint i=1;i<=n;++i)
		bdde(pre[1][i],i,1),bdde(i,pre[1][i],1);
	dfs(1,-1,0),dfs(n,-1,1);
	build(1,n,1);
	for(rint i=1;i<=m;++i)
		if(!ch(i))
		{
			x=lca(a[i],n,0),y=lca(b[i],1,1);
			update(x,y,dis[0][a[i]]+c[i]+dis[1][b[i]],1,n,1);
		}
	while(t--)
	{
		read(x),read(y);
		if(ch(x))
		{
			if(y<c[x])
				printf("%d\n",dis[0][n]-c[x]+y);
			else
				printf("%d\n",min(dis[0][n]+y-c[x],query(a[x],b[x],1,n,1)));
		}
		else
			if(y<c[x])
				printf("%d\n",min(dis[0][n],dis[0][a[x]]+y+dis[1][b[x]]));
		else
			printf("%d\n",dis[0][n]);
	}
	return 0;
}


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define rint register int
using namespace std;
typedef long long ll;
typedef pair<ll,int>pii;
const int N=200000+10;
bool vis[N];
ll y,b[N],dis[2][N],tr[N<<2];
int n,m,Q,ant[2],bnt,cnt,x;
int head[N],head2[2][N],a[N],c[N],id[N],pre[2][N],dep[2][N],p[2][N][20];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v,next;
	ll w;
}e[N<<1],f[2][N<<1];
inline void adde(int u,int v,ll w)
{
	e[++cnt]=(node){v,head[u],w};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++ant[op]]=(node){v,head2[op][u],0};
	head2[op][u]=ant[op];
}
template<class T>inline void read(T &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int st,int op)
{
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				pre[op][v]=u;
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<=17;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=17;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=17;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
void update(int L,int R,ll x,int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=min(tr[rt],x);
		return;
	}
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
ll query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	int m=(l+r)>>1;
	ll mn=1e18;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
int main()
{
	read(n),read(m),read(Q);
	memset(tr,0x3f,sizeof tr);
	memset(dis,0x3f,sizeof dis);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	dij(1,0),dij(n,1);
	for(rint i=2;i<=n;++i)
		bdde(i,pre[0][i],0),bdde(pre[0][i],i,0);
	for(rint i=1;i<n;++i)
		bdde(i,pre[1][i],1),bdde(pre[1][i],i,1);
	dfs(1,0,0),dfs(n,0,1);
	x=1;
	while(x!=n)
	{
		id[x]=++bnt;
		x=pre[1][x];
	}
	id[n]=++bnt;
	for(rint i=1;i<=m;++i)
	{
		int u=a[i],v=b[i];
		if(dis[0][u]>dis[0][v])
			swap(u,v);
		ll d=dis[0][u]+c[i]+dis[1][v];
		if(d==dis[0][n]&&(pre[0][v]==u||pre[1][u]==v))
			continue;
		int x=lca(u,n,0),y=lca(v,1,1);
		if(id[x]<id[y])
			update(id[x]+1,id[y],d,1,bnt,1);
	}
	for(rint i=1;i<=Q;++i)
	{
		read(x),read(y);
		int u=a[x],v=b[x];
		if(dis[0][u]>dis[0][v])
			swap(u,v);
		ll d=dis[0][u]+c[x]+dis[1][v];
		if(d==dis[0][n]&&(pre[0][v]==u||pre[1][u]==v))
		{
			ll ans=dis[0][u]+y+dis[1][v];
			if(id[u]<id[v])
				ans=min(ans,query(id[u]+1,id[v],1,bnt,1));
			printf("%lld\n",ans);
		}
		else
			printf("%lld\n",min(dis[0][n],dis[0][u]+y+dis[1][v]));
	}
	return 0;
}


#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#define lson o<<1
#define rson o<<1|1
#define mid (l+r)/2
#define ll long long
using namespace std;
struct Edge
{
	int to;
	int nxt;
	ll len;
}e[1000005];
int n,m,qq,edgenum,head[200005],from1[200005],fromn[200005],top,p[200005];
int anc1[26][200005],ancn[26][200005],dep1[200005],depn[200005];
ll dis1[200005],disn[200005];
priority_queue<pair<ll,int>,vector<pair<ll,int> >,greater<pair<ll,int> > >q;
void add(int u,int v,ll l)
{
	e[++edgenum].len=l;
	e[edgenum].to=v;
	e[edgenum].nxt=head[u];
	head[u]=edgenum;
}
void Dijkstra(int s,ll*dis,int*from,int*dep)
{
	while(!q.empty())q.pop();
	dis[s]=0;
	dep[s]=1;
	q.push(make_pair(0,s));
	while(!q.empty())
	{
		ll d=q.top().first;
		int node=q.top().second;
		q.pop();
		if(dis[node]!=d)continue;
		for(int hd=head[node];hd;hd=e[hd].nxt)
		{
			int to=e[hd].to;
			if(dis[to]>dis[node]+e[hd].len)
			{
				dis[to]=dis[node]+e[hd].len;
				from[to]=node;
				dep[to]=dep[node]+1;
				q.push(make_pair(dis[to],to));
			}
		}
	}
}
int LCA1(int u,int v)
{
	if(dep1[u]<dep1[v])swap(u,v);
	for(int i=0;dep1[u]-dep1[v];i++)
	  if((1<<i)&(dep1[u]-dep1[v]))
		u=anc1[i][u];
	if(u==v)return u;
	for(int i=20;i>=0;i--)
	{
		if(anc1[i][u]!=anc1[i][v])
		{
			u=anc1[i][u];
			v=anc1[i][v];
		}
	}
	return anc1[0][u];
}
int LCAn(int u,int v)
{
	if(depn[u]<depn[v])swap(u,v);
	for(int i=0;depn[u]-depn[v];i++)
	  if((1<<i)&(depn[u]-depn[v]))
		u=ancn[i][u];
	if(u==v)return u;
	for(int i=20;i>=0;i--)
	{
		if(ancn[i][u]!=ancn[i][v])
		{
			u=ancn[i][u];
			v=ancn[i][v];
		}
	}
	return ancn[0][u];
}
ll minv[1000005];
ll query(int o,int l,int r,int p)
{
	if(l==r)return minv[o];
	ll ans=minv[o];
	if(p<=mid)ans=min(ans,query(lson,l,mid,p));
	else ans=min(ans,query(rson,mid+1,r,p));
	return ans;
}
void update(int o,int l,int r,int from,int to,ll v)
{
	if(l>=from&&r<=to)
	{
		minv[o]=min(minv[o],v);
		return;
	}
	if(from<=mid)update(lson,l,mid,from,to,v);
	if(to>mid)update(rson,mid+1,r,from,to,v);
}
int main()
{
//	freopen("1.in","r",stdin);
//	freopen("2.out","w",stdout);
	scanf("%d%d%d",&n,&m,&qq);
	for(int i=1;i<=m;i++)
	{
		int u,v;
		ll l;
		scanf("%d%d%I64d",&u,&v,&l);
		add(u,v,l);
		add(v,u,l);
	}
	memset(dis1,0x3f,sizeof(dis1));
	memset(disn,0x3f,sizeof(disn));
	Dijkstra(1,dis1,from1,dep1);
	Dijkstra(n,disn,fromn,depn);
	for(int i=1;i<=n;i++)
	{
		anc1[0][i]=from1[i];
		ancn[0][i]=fromn[i];
	}
	for(int i=1;i<=20;i++)
	for(int j=1;j<=n;j++)
	{
		anc1[i][j]=anc1[i-1][anc1[i-1][j]];
		ancn[i][j]=ancn[i-1][ancn[i-1][j]];
	}
	int now=1;
	while(now!=n)
	{
		top++;
		p[now]=top;
		now=fromn[now];
	}
	memset(minv,0x3f,sizeof(minv));
	p[n]=top+1;
	for(int i=1;i<=edgenum;i+=2)
	{
		int u=e[i].to,v=e[i+1].to;
		if(dis1[u]>dis1[v])
			swap(u,v);
		ll d=dis1[u]+e[i].len+disn[v];
		if((from1[u]==v||fromn[u]==v)&&d==dis1[n])continue;
		int xu=LCA1(u,n),yv=LCAn(v,1);
		xu=p[xu],yv=p[from1[yv]];
		ll disuv=dis1[u]+e[i].len+disn[v];
		if(xu<=yv&&xu&&yv&&xu<=top&&yv<=top)update(1,1,top,xu,yv,disuv);
	}
	while(qq--)
	{
		int x;
		ll y;
		scanf("%d%I64d",&x,&y);
		x=2*x-1;
		int u=e[x].to,v=e[x+1].to;
		ll d=min(dis1[u]+e[x].len+disn[v],dis1[v]+e[x].len+disn[u]);
		if((from1[u]==v||fromn[u]==v)&&p[u]&&p[v]&&d==dis1[n])
		{
			ll ans=min(dis1[u]+disn[v]+y,disn[u]+dis1[v]+y);
			ans=min(ans,query(1,1,top,min(p[u],p[v])));
			printf("%I64d\n",ans);
		}
		else
		{
			ll ans=min(dis1[u]+disn[v]+y,disn[u]+dis1[v]+y);
			ans=min(ans,dis1[n]);
			printf("%I64d\n",ans);
		}
	}
	return 0;
}


#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rint register int
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair<ll,int>pii;
const int N=200000+10;
const ll inf=1e18;
bool vis[N];
int n,m,t,x,ant,bnt,cnt,dnt[2];
int a[N],b[N],id[N],head[N],head2[2][N],dep[2][N],p[2][N][20];
ll y,c[N],dis[2][N],tr[N<<2];
priority_queue<pii,vector<pii>,greater<pii> >q;
struct node
{
	int v;
	ll w;
	int next;
}e[N<<1],f[2][N<<2];
struct mode
{
	int l,r;
}l[2][N];
inline void adde(int u,int v,ll w)
{
	e[++cnt]=(node){v,w,head[u]};
	head[u]=cnt;
}
inline void bdde(int u,int v,int op)
{
	f[op][++dnt[op]]=(node){v,0,head2[op][u]};
	head2[op][u]=dnt[op];
}
template<class T>inline void read(T &x)
{
	x=0;
	int f=1;
	char s=getchar();
	while(s<'0'||s>'9')
	{
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9')
	{
		x=(x<<1)+(x<<3)+s-'0';
		s=getchar();
	}
	x*=f;
}
inline void dij(int op)
{
	int st=op?n:1;
	memset(vis,0,sizeof vis);
	q.push(make_pair(dis[op][st]=0,st));
	while(!q.empty())
	{
		int u=q.top().second;
		q.pop();
		if(vis[u])
			continue;
		vis[u]=1;
		for(rint i=head[u];~i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[op][v]>dis[op][u]+e[i].w)
			{
				l[op][v].l=u;
				l[op][u].r=v;
				dis[op][v]=dis[op][u]+e[i].w;
				q.push(make_pair(dis[op][v],v));
			}
		}
	}
}
void dfs(int u,int fa,int op)
{
	dep[op][u]=dep[op][fa]+1;
	p[op][u][0]=fa;
	for(rint i=1;i<20;++i)
		p[op][u][i]=p[op][p[op][u][i-1]][i-1];
	for(rint i=head2[op][u];~i;i=f[op][i].next)
	{
		int v=f[op][i].v;
		if(v==fa)
			continue;
		dfs(v,u,op);
	}
}
inline bool ch(int x)
{
	return dis[0][a[x]]+c[x]+dis[1][b[x]]==dis[0][n]&&(l[0][b[x]].l==a[x]||l[1][a[x]].l==b[x]);
}
inline int lca(int a,int b,int op)
{
	if(dep[op][a]>dep[op][b])
		swap(a,b);
	for(rint i=19;i>=0;--i)
		if(dep[op][a]<=dep[op][b]-(1<<i))
			b=p[op][b][i];
	if(a==b)
		return a;
	for(rint i=19;i>=0;--i)
		if(p[op][a][i]!=p[op][b][i])
			a=p[op][a][i],b=p[op][b][i];
	return p[op][a][0];
}
inline void pushup(int rt)
{
	tr[rt]=min(tr[rt<<1],tr[rt<<1|1]);
}
void build(int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=inf;
		return;
	}
	int m=(l+r)>>1;
	build(lson),build(rson);
	pushup(rt);
}
void update(int L,int R,ll x,int l,int r,int rt)
{
	if(l==r)
	{
		tr[rt]=min(tr[rt],x);
		return;
	}
	int m=(l+r)>>1;
	if(L<=m)
		update(L,R,x,lson);
	if(m<R)
		update(L,R,x,rson);
	pushup(rt);
}
ll query(int L,int R,int l,int r,int rt)
{
	if(L<=l&&r<=R)
		return tr[rt];
	int m=(l+r)>>1;
	ll mn=inf;
	if(L<=m)
		mn=query(L,R,lson);
	if(m<R)
		mn=min(mn,query(L,R,rson));
	return mn;
}
inline void change(int x,int y,int op)
{
	int z=l[op][x].l,w=l[op][y].r;
	l[op][z].r=y;
	l[op][y].l=z;
	l[op][x].r=w;
	l[op][w].l=x;
	l[op][y].r=x;
	l[op][x].l=y;
}
signed main()
{
	read(n),read(m),read(t);
	memset(l,-1,sizeof l);
	memset(head,-1,sizeof head);
	memset(head2,-1,sizeof head2);
	for(rint i=1;i<=m;++i)
	{
		read(a[i]),read(b[i]),read(c[i]);
		if(a[i]>b[i])
			swap(a[i],b[i]);
		adde(a[i],b[i],c[i]),adde(b[i],a[i],c[i]);
	}
	for(rint i=1;i<=n;++i)
		dis[0][i]=dis[1][i]=inf;
	dij(0),dij(1);
	for(rint i=1;i<=m;++i)
		if(dis[0][a[i]]>dis[0][b[i]])
			change(a[i],b[i],0),change(a[i],b[i],1),swap(a[i],b[i]);
	x=1;
	while(x!=n)
	{
		id[x]=++ant;
		x=l[1][x].l;
	}
	id[n]=++ant;
	for(rint i=1;i<=n;++i)
		bdde(l[0][i].l,i,0),bdde(i,l[0][i].l,0);
	for(rint i=1;i<=n;++i)
		bdde(l[1][i].l,i,1),bdde(i,l[1][i].l,1);
	dfs(1,-1,0),dfs(n,-1,1);
	build(1,ant,1);
	for(rint i=1;i<=m;++i)
		if(!ch(i))
		{
			int u=id[lca(a[i],n,0)],v=id[lca(b[i],1,1)];
			if(u>v)
				swap(u,v);
			if(u!=v&&u&&v)
				update(u,v,dis[0][a[i]]+c[i]+dis[1][b[i]],1,ant,1);
		}
	while(t--)
	{
		read(x),read(y);
		if(ch(x))
		{
			ll ans=dis[0][n]-c[x]+y;
			int u=id[lca(a[x],n,0)],v=id[lca(b[x],1,1)];
			if(u>v)
				swap(u,v);
			if(u!=v&&u&&v)
				ans=min(ans,query(u,v,1,ant,1));
			printf("%lld\n",ans);
		}
		else
			printf("%lld\n",min(dis[0][n],dis[0][a[x]]+y+dis[1][b[x]]));
	}
	return 0;
}