max_val = 0
max_row = max_col = 1
for row in range(9):
    for col, val in enumerate(map(int, input().split())):
        if(val>max_val):
            max_val = val
            max_row = row+1
            max_col = col+1
print(f"{max_val}\n{max_row} {max_col}")