lets say you keep reading two int numbers every round
you save the first int numbers which they are not same and the last two numbers which they are not
so if you read this
2, 3
4,5
5,6
7,7
you print 2,3 and 5,6 which one is the best algorithm to code if you are not able to use linked lists