import java.util.Scanner class No26() { var input = Scanner(System. `in`) var cup = input.nextInt() var moveTimes = input.nextInt() var cups = mutableMapOf(1 to false, 2 to false, 3 to false) fun swap() { cups[cup] = true for (i in 1..moveTimes) { var move1 = input.nextInt() var move2 = input.nextInt() if (cups[move1] == true) { cups[move1] = false cups[move2] = true } else if (cups[move2] == true) { cups[move1] = true cups[move2] = false } } for ( (key, value) in cups ) { if (value == true) println(key) } } } fun main(args: Array){ var no26 = No26() no26.swap() }