Niebieskie ksi.eczki
II Olympiad in Informatics 1994/1995

Task: JED
Author: Andrzej Walat*
Ones And Zeros

I stage contest  

Certain positive integers have their decimal representation consisting only of ones and zeros, and having at least one digit one, e.g. 101. If a positive integer has not such a property, one can try to multiply it by some positive integer to find out whether the product has this property.

Task

Write a program that:

The answer is either a positive multiple of n whose decimal representation consists of at most 100 (a hundred) digits, only zeros or ones, or the word BRAK ("absence"), if there is no such multiple.

Input

The file JED.IN contains in the first line a positive integer K<1000. In consecutive lines there is a sequence of K numbers in the range of [1..20000], one number per line. The numbers in the file JED.IN are written correctly, and your program need not verify that.

Output

Each line of the file JED.OUT, starting with the first, should contain:

The answers are to be written in JED.OUT in the same order as the corresponding numbers in JED.IN.

Example

For the file JED.IN:
6
17
11011
17
999
125
173
the file JED.OUT may have the following form:
11101
11011
11101
111111111111111111111111111
1000
1011001101

Your program should look for the file JED.IN in the current directory and create the file JED.OUT also in the current directory. The source file containing the program written by you should be named JED.???, where ??? are substituted by at most three-letter abbreviation of the programming language used. The same program in an executable form should be written in a file JED.EXE.


* The task comes from a collection of Romanian problems. Dr. Andrzej Walat has compiled the contents and he is the author of the solutions.