A higher resolution is required to access the IDE

- 177

## Statement

## Goal

In the classic code-breaking game of Bulls and Cows, your opponent chooses a- Each bull indicates a digit in your guess that exactly matches the value and position of a digit in your opponent's secret number.

- Each cow indicates a digit in your guess that matches the value of a digit in your opponent's secret number, but is in the wrong position.

So for example, if the secret number is

You will be given a series of guesses along with the number of bulls and cows in each guess. Your job is to determine the secret number based on the given information.

**NOTE:**This version of the game deviates from the classic Bulls and Cows rules in that digits may be repeated any number of times in the secret number.

Input

**Line 1:**The number

`N`of guesses.

**Next**A

`N`lines:`guess`, consisting of

`bulls`, another space, and then the number of

`cows`.

Output

The 4 -digit secret number.

Constraints

1 ≤

0≤

`N`≤ 200≤

`bulls`+`cows`≤ 4Example

Input

1 1234 4 0

Output

1234

A higher resolution is required to access the IDE