**Problem Description**

Now you have memorized the digits you guessed and the judgements you got, you feel like you can figure out the correct answer. Life is filled with wisdom, isn't it?

**Input**

There are several test cases. For each test case, the first line contains a single positive integer N indicates the times you can guess，the following N lines is the record of the guess, in the form:

#### #A#B

The first four numbers is the numbers guessed, then the judgements for your guess.

The input terminated when N is not postive integer, and not need to proceed.

**Output**

For each test case, output a single line contains exactly four digits that the computer has chosen. You may assume that each test case gives you enough information, so you can figure out the correct answer.

**Sample Input**

2 1234 2A4B 1243 0A4B 3 0732 3A3B 1526 0A0B 4567 0A2B -1

**Sample Output**

2134 0734

**Author**

Dr Wu

**Source**

Hunan University 2008 the 4th Programming Contest