/*
Sat Sep 13 10:44:11 EDT 1997
Sat Sep 13 10:58:30 EDT 1997
*/
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <math.h>

typedef struct {
	double x, y, angle;
} P;

int cmp( const void *ap, const void *bp ) {
	const P a = *(P *)ap, b = *(P *) bp;
	double d = a.angle - b.angle;
	return (d<0)? (-1) : ((d>0) ? 1 : 0 );
}

P west;
int westi;
P site[1000];
int ns; /* num sites */

int main() 
{
	int i, x,y, j;
	scanf(" %d ", &ns);
	for ( i=0; i<ns; i++ ) {
		scanf(" %d %d ",&x,&y);
		site[i].x = x;
		site[i].y = y;
	}
	/* Find westernmost (either, if two) site. */
	west = site[westi=0];
	for ( i=0;i<ns; i++ ) {
		if ( site[i].x < west.x ) { west = site[i]; westi = i;}
	}
	/* Find polar angle from |west| */
	for ( i=0;i<ns; i++ ) {
		if ( i == westi ) 
			site[i].angle = -200;  /* Something less than -PI. */
		else
			site[i].angle = atan2(site[i].y-west.y,site[i].x-west.x);
	}
	/* Now sort! Know thy libraries.*/
	qsort(site,(size_t)ns,sizeof(P),cmp);
	/* Find the origin,then print from there. */
	for (i=0; i<ns; i++ ) {
		if ( site[i].x == 0 && site[i].y == 0 ) break;
	}
	for (j=0;j<ns;j++) {
		printf("%d %d\n",(int)site[(j+i)%ns].x,(int)site[(j+i)%ns].y);
	}
	
	return 0;
}

