local mfl, mce = math.floor, math.ceil local n = io.read("*n") local ans = {} for x = 0, n do for y = 0, n do if n < x * y then break end if 0 < x + y then local rem = n - x * y if rem % (x + y) == 0 then local z = mfl(rem / (x + y)) table.insert(ans, x .. " " .. y .. " " .. z) end end end end print(#ans) print(table.concat(ans, "\n"))