push @{ $First{ $A[$_] } }, $_ for (0..$#A); push @{ $Second{ $B[$_] } }, $_ for (0..$#B);