_=*1..m=gets.to_i puts _.map{|j|(_.map{|i|i+(1+n=j-m-i)*n/2}&_)*' '}-['']