QOJ.ac

QOJ

حد الوقت: 2 s حد الذاكرة: 64 MB مجموع النقاط: 100 الصعوبة: [عرض]

#16444. Stone Game

الإحصائيات

There are two piles of stones with arbitrary, potentially different, quantities. The game begins with two players taking turns to remove stones. The rules state that in each turn, there are two possible moves: first, one can remove any number of stones from one of the piles; second, one can remove the same number of stones from both piles simultaneously. The player who takes the last stone wins. Given the initial number of stones in the two piles, and assuming both players play with an optimal strategy, determine if you are the winner or the loser if you go first.

Input

The input contains several lines, each representing an initial state of the game. Each line contains two non-negative integers $a$ and $b$, representing the number of stones in the two piles. Both $a$ and $b$ are no greater than $1,000,000,000$.

Output

The output should contain several lines, each containing a single digit $1$ or $0$. If you are the winner, output $1$; otherwise, output $0$.

Examples

Input 1

6 10

Output 1

0

Input 2

2 1
8 4
4 7

Output 2

0
1
0

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.