#include <fstream>
#include <vector>
#include <bitset>
#include <queue>
#include <algorithm>
#include <utility>
#include <cstring>
#include <string>
#include <stack>
#include <deque>
#include <iomanip>
#include <set>
#include <map>
#include <cassert>
#include <ctime>
#include <list>
#include <iomanip>
#define x first
#define y second
using namespace std;
string file = "infasuratoare";
ifstream cin( (file + ".in").c_str() );
ofstream cout( (file + ".out").c_str() );
const int MAXN = 120005;
const int oo = 0x3f3f3f3f;
typedef pair<double, double> pdd;
const inline int min(const int &a, const int &b) { if( a > b ) return b; return a; }
const inline int max(const int &a, const int &b) { if( a < b ) return b; return a; }
const inline void Get_min(int &a, const int b) { if( a > b ) a = b; }
const inline void Get_max(int &a, const int b) { if( a < b ) a = b; }
pdd P[MAXN];
int N, p, k, st[MAXN];
double X = oo, Y = oo;
struct ClassComp {
inline bool operator () (const pdd &a, const pdd &b) const {
return (a.x - X) * (b.y - Y) < (b.x - X) * (a.y - Y);
}
};
inline bool Match(pdd x, pdd y, pdd z) {
/*
double a = z.y - x.y,
b = x.x - z.x,
c = z.x*x.y - x.x*z.y;
double x1 = a*x.x + b*x.y + c;
double x2 = a*y.x + b*y.y + c;
double sol = x1 * x2;
*/
double sol = x.x * y.y + y.x * z.y + z.x * x.y - x.y * y.x - y.y * z.x - z.y * x.x;
return sol > 0;
}
int main() {
cin >> N;
for(int i = 1 ; i <= N ; ++ i) {
cin >> P[i].x >> P[i].y;
if(P[i].x < X || ( P[i].x == X && P[i].y < Y) ) {
X = P[i].x;
Y = P[i].y;
p = i;
}
}
swap(P[p], P[N]);
p = N;
sort(P + 1, P + N, ClassComp());
st[ ++ k ] = p;
for(int i = 1 ; i <= N ; ++ i) {
if(p == i)
continue;
while( k >= 2 && Match(P[st[k-1]], P[st[k]], P[i]))
-- k;
st[++k] = i;
}
cout << k << '\n';
cout << fixed << setprecision(6);
for(int i = k ; i ; -- i)
cout << P[st[i]].x << ' ' << P[st[i]].y << '\n';
cin.close();
cout.close();
return 0;
}