Game#2785

Game

1 second
64 megabytes
Easy

Grandpa Marat cherishes his granddaughter Masha, especially since she is the youngest in his family. He often engages her in various games.

For example, today they played a cognitive game called "Guess the Word." The rules are quite simple:

Grandpa recorded all of Masha's moves during the game. Now he wants to recall how the game ended. If Masha guessed the word, he wants to determine what it was. Otherwise, he wants to know whether she failed because there were several possible words, or because he made a mistake during the game.

Input

The first line of the input contains two integers and (1 \leq n, m \leq 3000) — the length of the word Grandpa thought of, and the number of moves in the game.

The following lines each contain a word s_i consisting of lowercase Latin letters, representing the word Masha chose on the -th move. The total length of all s_i combined does not exceed .

The last line contains a string of characters, each being either or . w_i = L means the word s_i was added to the left of the current string on the -th move, w_i = R means it was added to the right.

Output

Print Unique if Masha can uniquely determine the word Grandpa originally thought of, Ambiguous if there could be several such words, or Impossible if no such word exists and Grandpa made a mistake during the game.

Examples

Example 1

Loading
Loading