Jiro

AtCoder
IDabc371_a
Time2000ms
Memory256MB
Difficulty
There are three brothers named `A`, `B`, and `C`. The age relationships among them are given by three characters $S_{\mathrm{AB}}, S_{\mathrm{AC}}, S_{\mathrm{BC}}$, which mean the following: * If $S_{\mathrm{AB}}$ is `<`, then $A$ is younger than $B$; if it is `>`, then $A$ is older than $B$. * If $S_{\mathrm{AC}}$ is `<`, then $A$ is younger than $C$; if it is `>`, then $A$ is older than $C$. * If $S_{\mathrm{BC}}$ is `<`, then $B$ is younger than $C$; if it is `>`, then $B$ is older than $C$. Who is the middle brother, that is, the second oldest among the three? ## Constraints * Each of $S_{\mathrm{AB}}, S_{\mathrm{AC}}, S_{\mathrm{BC}}$ is `<` or `>`. * The input contains no contradictions; that is, there always exists an age relationship that satisfies all given inequalities. ## Input The input is given from Standard Input in the following format: $S_{\mathrm{AB}}$ $S_{\mathrm{AC}}$ $S_{\mathrm{BC}}$ [samples]
Samples
Input #1
< < <
Output #1
B

Since $A$ is younger than $B$, and $B$ is younger than $C$, we can determine that $C$ is the oldest, $B$ is the middle, and $A$ is the youngest. Hence, the answer is `B`.
Input #2
< < >
Output #2
C
API Response (JSON)
{
  "problem": {
    "name": "Jiro",
    "description": {
      "content": "There are three brothers named `A`, `B`, and `C`. The age relationships among them are given by three characters $S_{\\mathrm{AB}}, S_{\\mathrm{AC}}, S_{\\mathrm{BC}}$, which mean the following: *   If ",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc371_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "There are three brothers named `A`, `B`, and `C`. The age relationships among them are given by three characters $S_{\\mathrm{AB}}, S_{\\mathrm{AC}}, S_{\\mathrm{BC}}$, which mean the following:\n\n*   If ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments