li = list(map(int,input().split()))
h_list = []
for i in range(1,4):
for j in range(1,4):
idx = 3*(i-1)+j - 1
print('{:4d}'.format(li[idx]),end='')
h_list.append(li[idx])
print('{:4d}{:4d}'.format(max(h_list),sum(h_list)))
h_list = []