nums=[]
n = int(input())
string=""
for i in range(n):
    nums.append(input())
    string=string+"1"
times=0
while times<int(string,2):
    times+=1
    times_bin=str(bin(times))
    times_bin=times_bin[2::]
    C=""
    for i in range(n-len(times_bin)):
        times_bin = "0"+times_bin
    for i in range(len(times_bin)):
        if times_bin[i]=="1":
            C = C+str(nums[i])
    print(C)

d69713ef1e54535eccdd57ed94020dbfba397064
<mask token>

<mask token>
for i in range(n):
    nums.append(input())
    string = string + '1'
<mask token>
while times < int(string, 2):
    times += 1
    times_bin = str(bin(times))
    times_bin = times_bin[2:]
    C = ''
    for i in range(n - len(times_bin)):
        times_bin = '0' + times_bin
    for i in range(len(times_bin)):
        if times_bin[i] == '1':
            C = C + str(nums[i])
    print(C)

nums = []
n = int(input())
string = ''
for i in range(n):
    nums.append(input())
    string = string + '1'
times = 0
while times < int(string, 2):
    times += 1
    times_bin = str(bin(times))
    times_bin = times_bin[2:]
    C = ''
    for i in range(n - len(times_bin)):
        times_bin = '0' + times_bin
    for i in range(len(times_bin)):
        if times_bin[i] == '1':
            C = C + str(nums[i])
    print(C)

nums=[]
n = int(input())
string=""
for i in range(n):
    nums.append(input())
    string=string+"1"
times=0
while times<int(string,2):
    times+=1
    times_bin=str(bin(times))
    times_bin=times_bin[2::]
    C=""
    for i in range(n-len(times_bin)):
        times_bin = "0"+times_bin
    for i in range(len(times_bin)):
        if times_bin[i]=="1":
            C = C+str(nums[i])
    print(C)
