#include <stdio.h>
#include <algorithm>
#include <vector>
#define Point pair<double, double>
#define x first
#define y second
#define mp make_pair
#define MAXN 120005
using namespace std;
int n;
Point p[MAXN];
double crossProduct(Point A, Point B, Point C) {
// AB x AC
double x1 = B.x - A.x, y1 = B.y - A.y;
double x2 = C.x - A.x, y2 = C.y - A.y;
return x1 * y2 - x2 * y1;
}
bool Comp(Point A, Point B) {
return crossProduct(p[1], A, B) > 0;
}
int main()
{
freopen("infasuratoare.in", "r", stdin);
freopen("infasuratoare.out", "w", stdout);
scanf("%d", &n);
int lmost = 1;
for(int i = 1; i <= n; i++) {
scanf("%lf %lf", &p[i].x, &p[i].y);
if(p[i].x < p[lmost].x || (p[i].x == p[lmost].x && p[i].y < p[lmost].y))
lmost = i;
}
swap(p[1], p[lmost]);
sort(p + 2, p + n + 1, Comp);
vector<Point> H;
H.push_back(p[1]);
for(int i = 2; i <= n; i++) {
while(H.size() > 1 && crossProduct(H[H.size() - 2], H.back(), p[i]) < 0) H.pop_back();
H.push_back(p[i]);
}
printf("%d\n", H.size());
for(auto p: H)
printf("%.15f %.15f\n", p.x, p.y);
return 0;
}