A
A B C
B
Exact match
A B
B in A
B not in A
Remove Duplicates
&& Sort
A B