Problem: Based on a peculiar incident at basketball practice, Akari came up with the following competitive programming problem!

You are given n points on the plane, no three of which are collinear. The i-th point initially has a label a_i, in such a way that the labels a_1, a_2, ..., a_n form a permutation of 1, 2, ..., n.

You are allowed to modify the labels through the following operation:

  1. Choose two distinct integers i and j between 1 and n. 
  2. Swap the labels of points i and j, and finally 
  3. Draw the segment between points i and j. 



A sequence of operations is valid if after applying all of the operations in the sequence in order, the k-th point ends up having the label k for all k between 1 and n inclusive, and the drawn segments don't intersect each other internally. Formally, if two of the segments intersect, then they must do so at a common endpoint of both segments.

In particular, all drawn segments must be distinct.

Find any valid sequence of operations, or say that none exist. 

Input

The first line contains an integer n (3 ≤ n ≤ 2000) — the number of points.

The i-th of the following n lines contains three integers x_i, y_i, a_i (-10^6 ≤ x_i, y_i ≤ 10^6, 1 ≤ a_i ≤ n), representing that the i-th point has coordinates (x_i, y_i) and initially has label a_i.

It is guaranteed that all points are distinct, no three points are collinear, and the labels a_1, a_2, ..., a_n form a permutation of 1, 2, ..., n.

Output

If it is impossible to perform a valid sequence of operations, print -1.

Otherwise, print an integer k (0 ≤ k ≤ (n(n - 1))/(2)) — the number of operations to perform, followed by k lines, each containing two integers i and j (1 ≤ i, j ≤ n, i≠ j) — the indices of the points chosen for the operation.

Note that you are not required to minimize or maximize the value of k.

If there are multiple possible answers, you may print any of them.

Examples

Input


5
-1 -2 2
3 0 5
1 3 4
4 -3 3
5 2 1


Output


5
1 2
5 3
4 5
1 5
1 3


Input


3
5 4 1
0 0 2
-3 -2 3


Output


0

Note

The following animation showcases the first sample test case. The black numbers represent the indices of the points, while the boxed orange numbers represent their labels.

<image>

In the second test case, all labels are already in their correct positions, so no operations are necessary.

Solution (in CPP):

Solution:
#include<bits/stdc++.h>

using namespace std;

#define fr(i, n) for(int i = 0; i < n; i++)
#define frr(i, n) for(int i = 1; i <= n; i++)
#define frm(i, n) for(int i = n-1; i >= 0; i--)

#define pb push_back
#define f first
#define s second

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<vector<ll>> matrix;

#define mem(v, k) memset(v, k, sizeof(v));
#define db cout << "Debug" << endl;
#define all(x) begin(x), end(x)
#define dbg(x)  cout << #x << " = " << x << endl
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

#define mp make_pair
#define pq priority_queue

#define mx(a, b) a = max(a, b);
#define mod(a, b) a = a%b;

#define MAXN 2010
#define MOD 1000000007
#define MAXL 30
#define ROOT 1
#define INF 1000000000000000100

#define pdd pair<long double, long double>

pdd point[MAXN];
int a[MAXN], pai[MAXN], sz[MAXN];
int n;

int find(int x){
	if(pai[x] == x) return x;
	else return pai[x] = find(pai[x]);
}

void join(int a, int b){
	a = find(a), b = find(b);

	if(a == b) return;

	if(sz[a] < sz[b]) swap(a, b);
	sz[a] += sz[b];
	pai[b] = a;
}

long double get_angle(int c, int i){
	pdd aux = {point[i].f - point[c].f, point[i].s - point[c].s};
	long double tam = sqrt(aux.f*aux.f + aux.s*aux.s);

	aux.f /= tam, aux.s /= tam;

	if(point[i].s >= point[c].s) {
		return acos(aux.f);
	}
	else
		return 2*acos(-1) - acos(aux.f);
}

vector<int> radial(int c){
	vector<pair<long double, int>> v;
	frr(i, n){
		if(i == c || a[i] == i) continue;
		v.pb({get_angle(c, i), i});
	}
	sort(all(v));
	vector<int> ans;
	for(auto x: v) ans.pb(x.s);
	return ans;
}

int main(){
	fastio;
	cin >> n;
	
	frr(i, n){
		sz[i] = 1;
		pai[i] = i;
	}

	int center = 0, achou = 0;
	point[0].s = MOD;

	frr(i, n){
		cin >> point[i].f >> point[i].s >> a[i];
		join(i, a[i]);
		
		if(a[i] != i){
			achou = 1;
			if(point[center].s >= point[i].s - 0.0001){
				center = i;
			}
		}
	}

	if(achou == 0){
		cout << 0 << endl;
		exit (0);
	}

	vector<int> ord = radial(center);
	vector<pii> ans;

	fr(i, ord.size() - 1){
		if(find(ord[i]) != find(ord[i+1])){
			join(ord[i], ord[i+1]);
			ans.pb({ord[i], ord[i+1]});
			swap(a[ord[i]], a[ord[i+1]]);
		}
	}

	/*
	if(point[1].f == 851245) {
		cout << ans.size() << endl;
		cout << center << endl;
	}
	*/
	while(a[center] != center){
		int aux = a[center];
		ans.pb({aux, center});
		swap(a[aux], a[center]);
	}

/*
	if(n == 500){
		cout << point[ans[457].f].f << " " << point[ans[457].f].s << endl;
		cout << point[ans[457].s].f << " " << point[ans[457].s].s << endl;

		cout << point[ans[463].f].f << " " << point[ans[463].f].s << endl;
		cout << point[ans[463].s].f << " " << point[ans[463].s].s << endl;

		cout << point[center].f << " " << point[center].s << endl;
	}
*/
	cout << ans.size() << endl;
	for(auto x: ans){
		cout << x.f << " " << x.s << endl;
	}
}