Imagine we have a set of distinct natural numbers which we divide into two unsorted lists $A$ and $B$. Then, there is a third list $E$ containing pairs of (pairwise) distinct natural numbers. We would like to see if $E$ contains a pair of natural numbers $(c,d)$ such that $c \in A$ and $d \in B$ or $c \in B$ and $d \in A$. How could we apply Grover's algorithm to solve this task?
To give a concrete example, take $A = \{ 2,83,6,11\}$ and $B =\{ 34,12,41,89,5,90\}$ and $E = \{ (11,83), (12,5),(83,6),(11,41),(90,41)\}$. In this case, $(11,41)$ is the desired element since $11\in A$ and $41\in B$. All other elements in $E$ consist of p[airs of numbers both of which are either in $A$ or in $B$. In general, $E$ can contain elements $(c,d)$ such that $c\notin A,B$ and $d\notin A,B$, but we can exclude this possibility for simplicity.
I am guessing that this is a fairly simple and well-studied application of Grover's algorithm but I have trouble figuring out how this would work. In particular, how would many times would we need to apply the search oracle to solve this problem, given the numbers of elements in $A$, $B$, and $E$?
Any help is much appreciated.