import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, *H = map(int, read().split())
cnt = 1

H.sort()

ans = H[0]
print(H)
for i in H[1:]:
    print(ans, cnt)

    ans += cnt * i
    cnt *= 2
    print(ans, cnt)
print(ans / cnt)
