import java.util.*;

public class tdTotd {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        if (n = 0) {
            System.out.println("Invalid input");
            sc.close();
            return;
        }

        int h = n * n;
        int a[] = new int[h];

        for (int i = 0; i < h; i++) {
            if (!sc.hasNextInt()) {
                System.out.println("Invalid input");
                sc.close();
                return;
            }
            a[i] = sc.nextInt();
            if (a[i] < 0) {
                System.out.println("Invalid input");
                sc.close();
                return;
            }
        }

        for (int i = 0; i < h; i++) {
            System.out.print(a[i] + " ");
            if ((i + 1) % n == 0) {
                System.out.println();
            }
        }

        sc.close();
    }
}
