Problem: The Cybermen have again outwitted the Daleks! Unfortunately, this time the Daleks decided to abandon these tasks altogether, which means the Doctor has to deal with them.

The Doctor can handle the Daleks on his own, but Heidi now has to make sure that the Cybermen are kept busy with this next task.

There are k rings on a plane. For each ring, n points are uniformly sampled with a small random noise. The task is to recover the rings given only the noisy samples.

The rings and the samples are generated as follows. The center of a ring is uniformly sampled from a disk of radius 1 000 000 centered at the origin, and the radius of the ring is uniformly sampled from [250 000, 750 000]. Let R be a ring with center (x, y) and radius r. To sample a point from R, an angle θ is uniformly sampled from [0, 2π] and a distance d is uniformly sampled from [0.9r, 1.1r]. The coordinates of the sampled point are then (x+dcos(θ), y+dsin(θ)) rounded to the closest integers.

The distance between rings is measured by their Hausdorff distance. In our case, the distance between two rings R_1, R_2 can be written as follow. Let d be the distance between the two centers and r_1, r_2 be the radii. Then the distance is $$$dist(R_1, R_2)=max(min(d_{--}, d_{-+}),min(d_{+-}, d_{++}), min(d_{--}, d_{+-}), min(d_{-+}, d_{++})), where d_{++}=|d+r_1+r_2|, d_{+-}=|d+r_1-r_2|, d_{-+}=|d-r_1+r_2|, d_{--}=|d-r_1-r_2|$$$.

We say that a ring R_0 is recovered if one of the rings R in the output has Hausdorff distance less than 100 000 from R_0. 

An output is accepted if all the rings are recovered. It is guaranteed that the distances between any two rings is greater than 600 000.

Remember that a human can very easily solve this task, so make sure that no human traitors are helping the Cybermen complete this task.

Input

The first line contains an integer k (1 ≤ k ≤ 4), the number of rings.

The second line contains an integer n (100 ≤ n ≤ 1 000), the number of samples per ring.

The following n × k lines contain the samples, one sample per line.

Each line contains a pair of integers x_i, y_i, where (x_i, y_i) are the coordinates of the i-th sample.

Output

Print k lines, each describing a single ring.

For each line, print three real numbers x_i, y_i, r_i, where (x_i, y_i) and r_i are the coordinates and the radius of the i-th ring.

The order of the rings does not matter.

Note

Here is how one of tests with k=4 and n=100 looks like. 

<image>

You can download the sample input and output [here](//assets.codeforces.com/rounds/1184/c1.zip).

Solution (in CPP):

Solution:
#include <algorithm>  
#include <iostream>  
#include <sstream>  
#include <string>  
#include <vector>  
#include <queue>  
#include <set>  
#include <map>  
#include <cstdio>  
#include <cstdlib>  
#include <cctype>  
#include <cmath>  
#include <cstring>
#include <list>  
#include <cassert>
#include <climits>
#include <bitset>
#include <chrono>
#include <random>
using namespace std;  

#define PB push_back  
#define MP make_pair  
#define SZ(v) ((int)(v).size())  
#define FOR(i,a,b) for(int i=(a);i<(b);++i)  
#define REP(i,n) FOR(i,0,n)  
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)  
#define REPE(i,n) FORE(i,0,n)  
#define FORSZ(i,a,v) FOR(i,a,SZ(v))  
#define REPSZ(i,v) REP(i,SZ(v))  
typedef long long ll;  
int gcd(int a,int b) { return b==0?a:gcd(b,a%b); }

const int MAXRING=4;
const int MAXEACH=1000;
const int MAXN=MAXRING*MAXEACH;
const double M_PI=acos(-1.0);
struct P { double x,y; P() {} P(double x,double y):x(x),y(y) {} };
struct Circle { P center; double r; Circle() {} Circle(P center,double r):center(center),r(r) {} };

double dist(const P &a,const P &b) { double dx=a.x-b.x,dy=a.y-b.y; return sqrt(dx*dx+dy*dy); }

int nring,neach,n;
P p[MAXN];

std::mt19937 rnd((int)std::chrono::steady_clock::now().time_since_epoch().count());

bool makecircle(const P &a,const P &b,const P &c,P &center,double &r) {
	double denx=2*(a.y*(c.x-b.x)+b.y*(a.x-c.x)+c.y*(b.x-a.x));
	double deny=2*(a.x*(c.y-b.y)+b.x*(a.y-c.y)+c.x*(b.y-a.y));
	if(fabs(denx)<1e-3||fabs(deny)<1e-3) return false;
	double cx2=c.x*c.x,bx2=b.x*b.x,cy2=c.y*c.y,by2=b.y*b.y,ax2=a.x*a.x,ay2=a.y*a.y;
	double numx=a.y*(cx2-bx2+cy2-by2)+b.y*(ax2-cx2+ay2-cy2)+c.y*(bx2-ax2+by2-ay2);
	double numy=a.x*(cx2-bx2+cy2-by2)+b.x*(ax2-cx2+ay2-cy2)+c.x*(bx2-ax2+by2-ay2);
	center=P(numx/denx,numy/deny); r=(dist(a,center)+dist(b,center)+dist(c,center))/3;
	return true;
}

vector<Circle> cans;
vector<pair<Circle,double>> opt;

double dist(const Circle &a,const Circle &b) {
	double d=dist(a.center,b.center);
	vector<double> v(4); REP(i,4) { double cur=d; if((i&1)==0) cur+=a.r; else cur-=a.r; if((i&2)==0) cur+=b.r; else cur-=b.r; v[i]=abs(cur); }
	double ret=0; REP(i,4) REP(diff,2) { int j=i^(1<<diff); ret=max(ret,min(v[i],v[j])); } return ret;
}

double calc(const Circle &c,const P &p) { return fabs(dist(c.center,p)-c.r); }
void addopt(Circle c) {
	vector<double> cur; REP(j,n) cur.PB(calc(c,p[j])); sort(cur.begin(),cur.end()); double sum=0; REP(j,neach) sum+=cur[j]; sum/=neach; //if(ismissing) printf("%lf\n",sum);
	if(SZ(opt)<nring) { opt.PB(MP(c,sum)); /*printf("%lf\n",sum);*/ return; }
	//bool ismissing=false; REPSZ(i,cans) { bool have=false; REPSZ(j,opt) if(dist(cans[i],opt[j].first)<100000) have=true; if(!have&&dist(cans[i],c)<100000) ismissing=true; }
	double bestval=1e200; int bestreplace=-1;
	REPSZ(replace,opt) {
		double before=0,after=0;
		REP(j,n) {
			double have=1e200; REPSZ(i,opt) if(i!=replace) have=min(have,calc(opt[i].first,p[j]));
			before+=min(have,calc(opt[replace].first,p[j])); after+=min(have,calc(c,p[j]));
		}
		//if(ismissing) printf("before=%lf after=%lf\n",before,after);
		if(after<before&&after<bestval) bestval=after,bestreplace=replace;
	}
	if(bestreplace!=-1) {
		//printf("replacing %lf with %lf\n",opt[bestreplace].second,sum);
		opt[bestreplace]=MP(c,sum);
	} else {
		//if(ismissing) printf("skipping %lf\n",sum);
	}
}

void solve() {
	vector<pair<Circle,double>> bestopt; double bestval=1e200;
	REP(rep,10) {
		opt.clear();
		REP(i,1000) {
			int a=rnd()%n,b=rnd()%n,c=rnd()%n; if(b==a||c==a||c==b) continue;
			P center; double r; if(!makecircle(p[a],p[b],p[c],center,r)) continue;
			addopt(Circle(center,r));
			//printf("(%lf,%lf) rad=%lf sum=%lf\n",center.x,center.y,r,sum);
		}
		assert(SZ(opt)==nring);
		double curval=0; REP(j,n) { double me=1e200; REPSZ(i,opt) me=min(me,calc(opt[i].first,p[j])); curval+=me; }
		if(curval<bestval) bestval=curval,bestopt=opt;
	}
	opt=bestopt;
}

void run() {
	scanf("%d%d",&nring,&neach); n=nring*neach;
	REP(i,n) scanf("%lf%lf",&p[i].x,&p[i].y);
	solve();
	REPSZ(i,opt) printf("%lf %lf %lf\n",opt[i].first.center.x,opt[i].first.center.y,opt[i].first.r);
}

void stress() {
	std::mt19937 genrnd(12312);
	const double omx=1000000;
	std::uniform_real_distribution<double> gensquare(-omx, omx);
	std::uniform_real_distribution<double> genradius(250000, 750000);
	std::uniform_real_distribution<double> genang(0, 2*M_PI);
	std::uniform_real_distribution<double> genmlt(0.9,1.1);
	int mxring=4;
	REP(rep,100) {
		nring=genrnd()%mxring+1;
		neach=genrnd()%(1000-100+1)+100;
		n=nring*neach;
		vector<Circle> c(nring);
		REP(i,nring) {
			while(true) { 
				double cx=gensquare(genrnd),cy=gensquare(genrnd); if(cx*cx+cy*cy>omx*omx) continue; 
				c[i].center=P(cx,cy); 
				c[i].r=genradius(genrnd);
				//printf("testing (%lf,%lf,%lf)\n",c[i].center.x,c[i].center.y,c[i].r);
				bool ok=true; REP(j,i) if(dist(c[i],c[j])<600000) ok=false; if(!ok) continue;
				break;
			}

			REP(j,neach) { 
				double ang=genang(genrnd),mlt=genmlt(genrnd);
				double x=floor(c[i].center.x+mlt*c[i].r*cos(ang)+.5),y=floor(c[i].center.y+mlt*c[i].r*sin(ang)+.5);
				p[i*neach+j]=P(x,y);
			}
		}
		shuffle(p,p+n,genrnd);
		cans=c;
		//if(rep!=29) continue;
		rnd=genrnd;
		solve();
		vector<int> perm(nring); REP(i,nring) perm[i]=i;
		double best=1e200; vector<int> bestperm;
		do {
			double cur=0; REP(i,nring) cur=max(cur,dist(c[i],opt[perm[i]].first)); if(cur<best) best=cur,bestperm=perm;
		} while(next_permutation(perm.begin(),perm.end()));
		printf("want:"); REP(i,nring) printf(" (x-%.0lf)^2+(y-%.0lf)^2=%.0lf^2",c[i].center.x,c[i].center.y,c[i].r); puts("");
		printf("have:"); REP(i,nring) printf(" (x-%.0lf)^2+(y-%.0lf)^2=%.0lf^2",opt[bestperm[i]].first.center.x,opt[bestperm[i]].first.center.y,opt[bestperm[i]].first.r); puts("");
		printf("rep=%d best=%lf\n",rep,best);
		if(best>400000) return;

	}
}

int main() {
	run();
	//stress();
	return 0;
}