10798 - 세로읽기
#10798
arr = []
for i in range(5):
a = list(input())
arr.append(a)
if len(a) < 15:
while len(a) != 15:
arr[i].append(0)
for j in range(15):
for i in range(5):
if arr[i][j] != 0:
print(arr[i][j], end='')
2490 - 윷놀이
#2490 윷놀이
yoot = 'ABCDE'
for i in range(3):
arr = list(map(int,input().split()))
cnt = 0
for j in range(len(arr)):
if arr[j] == 0:
cnt +=1
print(yoot[cnt-1])
2884 - 알람 시계
#2884 알람 시계
H, M = map(int,input().split())
if M<45:
M += 15
H -= 1
else :
M -= 45
if H < 0:
H = 23
print(H, M)