N = parse(Int64, strip(readline()))
nx = 1
pop = 0
res = zeros(Int64, N, N)
for i in 1:N
  for j in i+1:N
    res[i,j] = res[j,i] = nx
    nx,pop = nx+pop,nx
  end
end

for i in 1:N
  println(join(map(string, res[i,:]), ' '))
  
