using System; using System.Collections.Generic; using System.Linq; namespace yukicoder { public class Program { public static void Main() { var n = int.Parse(Console.ReadLine()); for(var i = 0; i < n; i++) { var a = new int[n]; for (var j = 0; j < n; j++) { var I = i + 1; var J = j + 1; a[j] = (n + 2 * I - J) % n; if (a[j] == 0) { a[j] = n; } } Console.WriteLine(String.Join(" ", a)); } } } }