r=range(input()+1) for i in r:print"".join("%-4d"%max(x*i,x,i)for x in r).strip()