Orange Boy Can You Solve It Out? Ep.44

String 思考题!!

Boggle Constructor

Ninetail is a clever fox girl. She loves to play Boggle!

the rules are simple:

Each player searches for words that can be constructed from the letters of sequentially adjacent cubes, where “adjacent” cubes are those horizontally, vertically, and diagonally neighboring. Words must be at least three letters long, may include singular and plural (or other derived forms) separately, but may not use the same letter cube more than once per word.

(wikipedia)

Today she has many words and she wants to put all of them in a 4*4 Boggle board. Each cell should contain only 1 character.

Show a possible construction or say it’s impossible.

Example

words={eat,ate,tea,tae,note,work,eater,workers,rest,sons}

Output

1
2
3
4
EANS
WTOT
OERS
RKET

the answer is not unique

words={internationalization}

Output

1
Impossible

Constraints

Subtask1(10%),

Subtask2(90%),

Each word contains at least 3 characters