Smile with Similes

No attempts yetTime limit1sMemory limit128 MB

Problem

A simile joins an adjective and a noun into a phrase such as "Easy as pie" or "Cold as ice".

You are given $n$ adjectives $(1 \le n \le 5)$ and $m$ nouns $(1 \le m \le 5)$. Print every possible simile of the form <adjective> as <noun>.

Input

  • The first line contains the integer $n$.
  • The second line contains the integer $m$.
  • The next $n$ lines each contain one adjective.
  • The following $m$ lines each contain one noun.

Output

Print all $n \times m$ similes, one per line. Iterate the adjectives in input order as the outer loop and, for each adjective, the nouns in input order as the inner loop. Each line has the form <adjective> as <noun>.