f=->n{n*~-n/2} g=->k{(0..2*k).find{|e|f[e]>=k}} a=g[k=gets.to_i];p a-~c=f[b=g[d=f[a]-k]]-d $><<([24]+[2]*b+[7]*c+[1]*a-=b)*' '