I try to solve it in this way:
1. Generate all possible words (which have exactly 2 vowels - AEIOUY)
2. Sort this words and remove duplicates
3. Generate all possible words for second board (in the same way) and using bsearch try to find it in first words - in success add such word to table with common words.
4. Sort common part and remove duplicates, and print it.
Is this way incorrect ? I always got WA

Best regards
DM