from typing import List, Union

def transpose_matrix(a: List[List[Union[int, float]]]) -> List[List[Union[int, float]]]:
    res = []
    width = len(a[0])
    height = len(a)
    for w in range(width):
        tmp = []
        for h in range(height):
            tmp.append(a[h][w])
        res.append(tmp)
    return res

def main():
    try:
        matrix_str = input().strip()
        rows = matrix_str[2:-2].split('],[')
        matrix = [list(map(int, row.split(','))) for row in rows]
        result = transpose_matrix(matrix)
        print(str(result).replace(' ', ''))
    except Exception as e:
        print(f"输入格式错误: {e}")
from typing import List, Union

def transpose_matrix(a: List[List[Union[int, float]]]) -> List[List[Union[int, float]]]:
    return [list(line) for line in zip(*a)]

def main():
    try:
        matrix_str = input().strip()
        rows = matrix_str[2:-2].split('],[')
        matrix = [list(map(int, row.split(','))) for row in rows]
        result = transpose_matrix(matrix)
        print(str(result).replace(' ', ''))
    except Exception as e:
        print(f"输入格式错误: {e}")