// Arup Guha
// 1/28/2026
// Solution to Question #5 for COP 3330 Quiz #1

import java.util.*;

public class quiz1q5 {

	public static void main(String[] args) {

		// Get user input.
		Scanner stdin = new Scanner(System.in);
		System.out.println("How many rows for your inverted pyramid?");
		int n = stdin.nextInt();
		
		// i is our row number, counting down.
		for (int i=n; i>=1; i--) {
			
			// Easiest for spaces to count down from n to i+1, inclusive.
			for (int j=n; j>i; j--)
				System.out.print(" ");
			
			// Print i, i number of times.
			for (int j=0; j<i; j++)
				System.out.print(i+" ");
			
			// Go to the next line.
			System.out.println();
		}
	}
}