#include int main() { int a; int b; std::cin >> a; // = 1 in the example std::cin >> b; // = 2 in the example a = a^b; // a is the XOR of a and b b = a^b; // b is (a^b)^b = a^(b^b) = a^0 = a a = a^b; // b's value is a at this point, so: a = a^b^a = b^(a^a) = b^0 = b std::cout << a << std::endl; std::cout << b << std::endl; return 0; }