#include <bits/stdc++.h>
using namespace std;
ifstream in("infasuratoare.in");
ofstream out("infasuratoare.out");
struct punct
{
double x, y;
}st[120001], v[120001];
int det(punct a, punct b, punct c)
{
return a.x * b.y + b.x * c.y + c.x * a.y - c.x * b.y - a.x * c.y - b.x * a.y;
}
bool cmp(punct a, punct b)
{
if(a.y<b.y)
return true;
else if(a.y>b.y)
return false;
else
{
if(a.x<b.x)
return true;
return false;
}
}
int main()
{
int n, nr = 1, k = 0;
in>>n;
for(int i = 1; i<=n; i++)
{
in>>st[i].x>>st[i].y;
}
sort(st+1, st+n+1, cmp);
int c = 2;
v[1] = st[1];
while(c != n)
{
if(det(st[1], st[n], st[c])<0)
{
while(nr>1 && det(v[nr-1], v[nr], st[c])<0)
--nr;
v[++nr] = st[c];
}
c++;
}
v[++nr] = st[n];
while(c != 1)
{
if(det(st[1], st[n], st[c])>0)
{
while(k>1 && det(v[nr-1], v[nr], st[c])<0)
--nr;
v[++nr] = st[c];
++k;
}
c--;
}
out<<nr<<endl;
for(int i = 1; i<=nr; i++)
out<<fixed<<setprecision(6)<<v[i].x<<" "<<v[i].y<<'\n';
return 0;
}