Strange_Functions
题号:NC231085
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Given n functions , where


For each function f_i(x), determine if there is an x_i that .

Note that:
  •  "" is the inverse function of "".
  •  .

输入描述:

The first line contains one integer , denoting the number of given functions.

Following n lines each contains two integers , denoting the given functions.

It is guaranteed that .

输出描述:

Output one line containing one 01-string S of length n, where iff such x_i exists, or .
示例1

输入

复制
3
1 1
3 2
2 3

输出

复制
101

说明

Here is an illustration for the sample case.