Takahashi is solving quizzes. He has easily solved all but the last one. The last quiz…
- User
Takahashi is solving quizzes. He has easily solved all but the last one.
The last quiz has three choices: 1, 2, and 3.
With his supernatural power, Takahashi has found out that the choices A and B are both wrong.
Print the correct choice for this problem.
Constraints
- Each of the numbers A and B is 1, 2, or 3.
- A and B are different. Input
Input is given from Standard Input in the following format:
A B
Output
Print the correct choice.
Examples
Input
3 1
Output
2
Input
1 2
Output
3
Assistant
We are asked: given two numbers A and B, each of which are 1, 2, or 3, and they are different. The quiz has three choices: 1, 2, and 3. Takahashi found out that choices A and B are both wrong. So the correct choice is the remaining number from {1,2,3} that is not A or B.
We need to output that number.
So we can simply compute: if A+B? Not exactly: possible sums: 1+2=3 -> correct is 3? Actually if A=1, B=2 then remaining is 3, but sum=3. If A=1, B=3 then remaining=2, sum=4. If A=2, B=3 then remaining=1, sum=5. So the remaining number is 6 - (A+B) because 1+2+3=6. So answer = 6 - A - B.
Thus we can read A, B and print 6 - A - B.
Edge cases: none; inputs are guaranteed to be 1,2,3 and distinct.
Implementation: read from stdin, parse ints, compute result.
Let's produce final answer.
We need to output the correct choice.
We'll write in Python for this solution.
We'll include explanation.
Now produce final. ```python
import sys
def main(): data = sys.stdin.read().strip().split() if len(data) < 2: return A = int(data[0]) B = int(data[1]) # The three choices sum to 6, and A and B are distinct and in {1,2,3} answer = 6 - A - B print(answer)
if name == "": main()
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.