# 만들 수 없는 금액
n = int(input())
coin = list(map(int, input().split()))
coin.sort()
target = 1

for c in coin:
    if c <= target:
        target += c
        print(target, " <- ", c)
    else:
        break
print(target)
fb8a5e3c0348fe1a522ee3bebdff99b27649d492
<mask token>

<mask token>
coin.sort()
<mask token>
for c in coin:
    if c <= target:
        target += c
        print(target, ' <- ', c)
    else:
        break
print(target)

n = int(input())
coin = list(map(int, input().split()))
coin.sort()
target = 1
for c in coin:
    if c <= target:
        target += c
        print(target, ' <- ', c)
    else:
        break
print(target)

# 만들 수 없는 금액
n = int(input())
coin = list(map(int, input().split()))
coin.sort()
target = 1

for c in coin:
    if c <= target:
        target += c
        print(target, " <- ", c)
    else:
        break
print(target)