Who Ate the Cake?

AtCoder
IDabc355_a
Time2000ms
Memory256MB
Difficulty
Takahashi's cake has been eaten by someone. There are three suspects: person $1$, person $2$, and person $3$. There are two witnesses, Ringo and Snuke. Ringo remembers that person $A$ is not the culprit, and Snuke remembers that person $B$ is not the culprit. Determine if the culprit can be uniquely identified based on the memories of the two witnesses. If the culprit can be identified, print the person's number. ## Constraints * $1 \leq A, B \leq 3$ * All input values are integers. ## Input The input is given from Standard Input in the following format: $A$ $B$ [samples]
Samples
Input #1
1 2
Output #1
3

From the memories of the two witnesses, it can be determined that person $3$ is the culprit.
Input #2
1 1
Output #2
\-1

From the memories of the two witnesses, it cannot be determined whether person $2$ or person $3$ is the culprit. Therefore, print `-1`.
Input #3
3 1
Output #3
2
API Response (JSON)
{
  "problem": {
    "name": "Who Ate the Cake?",
    "description": {
      "content": "Takahashi's cake has been eaten by someone. There are three suspects: person $1$, person $2$, and person $3$. There are two witnesses, Ringo and Snuke. Ringo remembers that person $A$ is not the culpr",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc355_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Takahashi's cake has been eaten by someone. There are three suspects: person $1$, person $2$, and person $3$.\nThere are two witnesses, Ringo and Snuke. Ringo remembers that person $A$ is not the culpr...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments