Yesterday Professor Q rode on a bus with his friend. As soon as he got the tickets for himself and his friend, which were consecutively numbered with each of the tickets bearing a 5-digit number with no leading zero, he added the digits on them and told his friend that the sum of all ten digits was exactly 62. His logical friend asked him if the sum of the numbers on either of the tickets was by any chance 35. Professor Q answered his friend, whereby his friend immediately deduced the numbers on the bus tickets. What were the numbers on the two bus tickets?