# -*- coding: utf-8 -*-
# ABC138C

n = int(input())
v = list(map(int, input().split()))

while len(v) > 1:
    a = min(v)
    v.remove(a)
    print(a,v)
    b = min(v)
    v.remove(b)
    print(b,v)
    c = (a + b) / 2
    v.append(c)
    
print(v.pop())