#include <stdio.h>
#include <math.h>
#include <algorithm>
#define PI 3.14159265
using namespace std;
long i,N,P,u;
double X[120001],Y[120001],polar[120001];
long stiva[120001];
void swap (long x, long y)
{
double aux;
aux=x;
x=y;
y=aux;
}
double unghi_polar (long pct)
{
double a,b,c;
a=sqrt(X[pct]*X[pct]+(Y[P]-Y[pct])*(Y[P]-Y[pct]));
b=sqrt((X[pct]-X[P])*(X[pct]-X[P])+(Y[pct]-Y[P])*(Y[pct]-Y[P]));
c=X[P];
return acos((b*b+c*c-a*a)/(2*b*c))*180/PI;
}
void sort_polar (double x[], double y[], double pol[], long prim, long ultim)
{
long min=prim,max=ultim;
double aux,separator_lista=pol[(prim+ultim)/2];
do
{
while (pol[min]<separator_lista) min++;
while (pol[max]>separator_lista) max--;
if (min<=max)
{
swap(x[min],x[max]);
swap(y[min],y[max]);
swap(pol[min],pol[max]);
min++; max--;
}
}
while (min<=max);
if (prim<max) sort_polar(x,y,pol,prim,max);
if (min<ultim) sort_polar(x,y,pol,min,ultim);
}
bool verificare (long p1,long p2,long p3)
{
if ((X[p2]-X[p1])*(Y[p3]-Y[p1])-(Y[p2]-Y[p1])*(X[p3]-X[p1])<0) return 1;
else return 0;
}
int main ()
{
freopen("infasuratoare.in", "r", stdin);
freopen("infasuratoare.out", "w", stdout);
scanf("%d", &N);
scanf("%lf %lf", &X[1], &Y[1]);
P=1;
for (i=2; i<=N; i++)
{
scanf("%lf %lf", &X[i], &Y[i]);
if (Y[P]>Y[i]) P=i;
else if (Y[P]==Y[i] && X[P]>X[i]) P=i;
}
swap (X[1],X[P]); swap (Y[1],Y[P]); P=1;
for (i=2; i<=N; i++) polar[i]=unghi_polar(i);
sort_polar(X,Y,polar,2,N);
stiva[1]=1;
stiva[2]=2;
u=2;
for (i=3; i<=N; i++)
{
if (verificare (stiva[u-1],stiva[u],i))
stiva[++u]=i;
else
{
while (verificare (stiva[u-1],stiva[u],i)) u--;
stiva[u]=i;
}
}
//printf("%d\n", P);
//for (i=1; i<=N; i++) printf("%lf %lf %lf\n", X[i], Y[i], polar[i]);
printf("%d\n",u);
printf("%lf %lf\n", X[stiva[1]],Y[stiva[1]]);
for (i=u; i>=2; i--) printf("%lf %lf\n", X[stiva[i]],Y[stiva[i]]);
return 0;
}