#D13248. A polyline

    ID: 11014 Type: Default 2000ms 256MiB

A polyline

A polyline

Input

The input contains two integers a, b (1 ≤ a ≤ 10, 0 ≤ b ≤ 22·a - 1) separated by a single space.

Output

Output two integers separated by a single space.

Examples

Input

1 0

Output

0 0

Input

2 15

Output

3 0

Input

4 160

Output

12 12

inputFormat

Input

The input contains two integers a, b (1 ≤ a ≤ 10, 0 ≤ b ≤ 22·a - 1) separated by a single space.

outputFormat

Output

Output two integers separated by a single space.

Examples

Input

1 0

Output

0 0

Input

2 15

Output

3 0

Input

4 160

Output

12 12

样例

1 0
0 0