3
1 1
2 1
2 2
Hint For the sample, we can prove that the minimal $k$ is $3$. Here, we use $A_i$ to indicate the $i$-th vertex in set $A$ and $B_i$ to indicate the $i$-th vertex in set $B$. The longest path from $A_1$ to $B_1$ is $A_1\to B_2\to A_2\to B_1$. The longest path from $A_2$ to $B_1$ is $A_2\to B_2\to A_1\to B_1$. The longest path from $A_1$ to $B_2$ is $A_1\to B_1\to A_2\to B_2$. The longest path from $A_2$ to $B_2$ is $A_2\to B_1\to A_1\to B_2$. The answer $(1,1),(2,2),(2,1)$ is also valid, but it is not lexicographically smallest.