I used to see a generalized version of 1658D2 - 388535 (усложненная версия) which unfortunately I can't solve in an old Petrozavodsk contest. That is to say, given two arrays $$$a_1, \dots, a_n$$$ and $$$b_1, \dots, b_n$$$, find the least $$$x$$$ where the multiset $$${a_1 \oplus x, \dots, a_n \oplus x}$$$ and $$${b_1, \dots, b_n}$$$ are identical.
The constraint may be $$$n \leq 10^5$$$ and $$$a_i, b_i < 2^{30}$$$.
As the task somehow reappears, I think it's the best time I can ask for help.
I also appreciate who provides the exact source of the mentioned task. Thanks in advance.