aa =[]
for i in range (5):
a = input()
aa.append(a)
for j in range(15): #์ต๋ ๊ธธ์ด 15
for i in range (5): # 0~5์ค
if j < len(aa[i]): #j ๊ฐ ์กฐ์ (aa[i] 2์ฐจ์๋ฐฐ์ด ๊ธธ์ด)
print(aa[i][j], end="")
aa =[]
for i in range (5):
a = input()
aa.append(a)
for j in range(15): #์ต๋ ๊ธธ์ด 15
for i in range (5): # 0~5์ค
if j < len(aa[i]): #j ๊ฐ ์กฐ์ (aa[i] 2์ฐจ์๋ฐฐ์ด ๊ธธ์ด)
print(aa[i][j], end="")