n | a = [] | n | matrix = [] |
| first_line = input().strip() | | first_line = input().strip() |
| N = len(first_line.split(',')) | | N = len(first_line.split(',')) |
n | a.append(first_line.split(',')) | n | matrix.append(first_line.split(',')) |
| for _ in range(N - 1): | | for _ in range(N - 1): |
| line = input().strip() | | line = input().strip() |
n | a.append(line.split(',')) | n | matrix.append(line.split(',')) |
| for i in range(len(a)): | | for row_index in range(len(matrix)): |
| j = 0 | | col_index = 0 |
| while i != j: | | while row_index != col_index: |
| print(a[i][j], end=',') | | print(matrix[row_index][col_index], end=',') |
| j += 1 | | col_index += 1 |
| if i == j and i == 0: | | if row_index == col_index and row_index == 0: |
| print(a[i][j], end='') | | print(matrix[row_index][col_index], end='') |
| else: | | else: |
n | print(a[i][j], end=',') | n | print(matrix[row_index][col_index], end=',') |
| i -= 1 | | row_index -= 1 |
| while i >= 0: | | while row_index >= 0: |
| if i != 0: | | if row_index != 0: |
| print(a[i][j], end=',') | | print(matrix[row_index][col_index], end=',') |
| else: | | else: |
t | print(a[i][j], end='') | t | print(matrix[row_index][col_index], end='') |
| i -= 1 | | row_index -= 1 |
| print() | | print() |