public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);

		while (cin.hasNext()) {
			int row = cin.nextInt();
			char[][] board = new char[row][];

			for (int i = 0; i < row; i++) {
				String str = cin.next();
				board[i] = new char[str.length()];
				for (int j = 0; j < board[i].length; j++) {
					board[i][j] = str.charAt(j);
				}
			}

			solve(board);

			for (int i = 0; i < board.length; i++) {
				for (int j = 0; j < board[0].length; j++) {
					System.out.printf("%c ", board[i][j]);
				}
				System.out.println();
			}
		}

		cin.close();
	}