input: 1362. answers: 82 and 138