Scientists have discovered different types of alien genetic material, sharing common structure:
- 3 dimensional dimensional lattice lattice of cubes of distinctive components ( of cubes of distinctive components ( letters letters)
- Each lattice has a finite number of letters in its alphabet โ from 2 up to 100
- The lattice sizes range from 444 up to 100010001000
Scientists have also discovered dictionaries of words from the genetic alphabet:
- The dictionary size ranges from 3 up to 1000 words
- All words in a common dictionary share the same length, from 2 up to 100
The scientists hypothesise that dictionaries are associated to some of the genetic material, provided all words in the dictionary can be found in sequence (horizontal, vertical or diagonal) in the material lattice. You are to write a program that takes as input any lattice material and any dictionary, and returns a boolean stating whether there is an association between the two.