N=gets.to_i for i in 1..N for j in i..N if j<=(N-i-j) puts("#{i} #{j} #{N-i-j}") end end end