Let $a_1, a_2,\cdots , a_n$ and $b_1, b_2,\cdots , b_n$ be (not necessarily distinct) positive integers. We continue the sequences as follows: For every $i>n$, $a_i$ is the smallest positive integer which is not among $b_1, b_2,\cdots , b_{i-1}$, and $b_i$ is the smallest positive integer which is not among $a_1, a_2,\cdots , a_{i-1}$. Prove that there exists $N$ such that for every $i>N$ we have $a_i=b_i$ or for every $i>N$ we have $a_{i+1}=a_i$.
Problem
Source: Lotfi Zadeh Olympiad 2021, Problem 2
Tags: number theory with sequences, Lotfi Zadeh MO