n = gets.to_i

list = []
n.times{|i|
  list[i] = gets.split.map(&:to_f)
}

list.sort! {|a, b| a[0] == b[0] ? a[1] <=> b[1] : a[0] <=> b[0]}

max = []
min = []

n.times{|i|
  (i+1).upto(n-1){|j|
    del = (list[j][1] - list[i][1]) / (list[j][0] - list[i][0])
    max[i] ||= [del, j]
    min[i] ||= [del, j]
    max[i] = [del, j] if max[i][0] < del
    min[i] = [del, j] if min[i][0] > del
  }
}

up = [list[0]]
i = 0
loop do
  i = max[i][1]
  up << list[i]
  break if i == n - 1
end

down = []
i = 0
loop do
  i = min[i][1]
  break if i == n - 1
  down << list[i]
end
used = down + up.reverse

s = used.min{|a, b| a[1] == b[1] ? a[0] <=> b[0] : a[1] <=> b[1]}
while s != used[0]
  used.push(used.shift)
end
puts used.size
used.each{|pt|
  puts "#{pt[0].to_i} #{pt[1].to_i}"
}