### constant

S_IN = 0
S_OUT = 1

DELTA = 1e-17

### subroutines

def shadow(cyls, th)
  cth = Math.cos(th)
  sth = Math.sin(th)
  ylines = []

  cyls.each do |x, y|
    y0 = sth * x + cth * y
    ylines << [y0 - 1, S_IN]
    ylines << [y0 + 1, S_OUT]
  end

  width = 0.0
  nsh = 0
  yin = nil

  ylines.sort.each do |y, io|
    if io == S_IN
      yin = y if nsh == 0
      nsh += 1
    else
      nsh -= 1
      width += y - yin if nsh == 0
    end
  end

  width
end

def get_min_th(cyls, th0, th1)
  loop do
    w0 = shadow(cyls, th0)
    w1 = shadow(cyls, th1)
    break if (w1 - w0).abs < DELTA

    thh = (th0 + th1) / 2
    if w0 > w1
      th0 = thh
    else
      th1 = thh
    end
  end
  (th0 + th1) / 2
end

def get_max_th(cyls, th0, th1)
  loop do
    w0 = shadow(cyls, th0)
    w1 = shadow(cyls, th1)
    break if (w1 - w0).abs < DELTA

    thh = (th0 + th1) / 2
    if w0 < w1
      th0 = thh
    else
      th1 = thh
    end
  end
  (th0 + th1) / 2
end

### main

loop do
  n = gets.to_i
  break if n == 0

  cyls = n.times.map{gets.split.map(&:to_f)}

  min_th = max_th = nil
  min_w = n * 2.0
  max_w = 0.0

  for i in (0..180)
    th = Math::PI * i / 180
    w = shadow(cyls, th)
    if min_w > w
      min_w = w
      min_th = th
    end
    if max_w < w
      max_w = w
      max_th = th
    end
  end

  dth = Math::PI / 180
  min_th0 = (min_th > dth) ? min_th - dth : 0.0
  min_th1 = (min_th < Math::PI - dth) ? min_th + dth : Math::PI
  min_th = get_min_th(cyls, min_th0, min_th1)

  max_th0 = (max_th > dth) ? max_th - dth : 0.0
  max_th1 = (max_th < Math::PI - dth) ? max_th + dth : Math::PI
  max_th = get_max_th(cyls, max_th0, max_th1)

  puts "%.15f" % min_th
  puts "%.15f" % max_th
end