Tiles

Your task is to write a program that tiles a rectangle f×cf \times c with tiles a×ba \times b. For each one of the 26 uppercase letters, there exactly is a vertical tile and a horizontal tile available, of which can be used at most one. For instance, if a=1a = 1 and b=3b = 3, we can use at most one of these two tiles:

image

The rectangle must be totally covered, and any piece of the used tiles can be left. If there are more than a way to tile, your prorgram must find the less in alphabetical order, reading from top to bottom and from left to right. In the case that does not exist any possible way, your program must indicate it.

Input

The input consists of a series of lines, each one with aa, bb, ff and cc in this order. All the numbers are between 1 and 50.

Output

For each line of the input, your program must print the least lexicographically tiling, or "!!!" if does not exist any. Separate the answers with a line in white.

Scoring

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T12:13:29.155Z

© Jutge.org, 2006–2026.
https://jutge.org