def c v puts "#{v} = 6 * %s 1" % ((v-1) % 6 == 0? "#{(v-1)/6} +" :"#{(v +1)/6} -") end while r=gets do c r.to_i end