103710: [Atcoder]ABC371 A - Jiro
Description
Score : $150$ points
Problem Statement
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}}$
Output
Print the name of the middle brother, that is, the second oldest among the three.
Sample Input 1
< < <
Sample 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
.
Sample Input 2
< < >
Sample Output 2
C
Output
得分:150分
问题陈述
有三个兄弟,分别叫A
、B
和C
。他们之间的年龄关系由三个字符$S_{\mathrm{AB}}$、$S_{\mathrm{AC}}$、$S_{\mathrm{BC}}$给出,这意味着以下内容:
- 如果$S_{\mathrm{AB}}$是
<
,那么$A$比$B$年轻;如果是>
,那么$A$比$B$年长。 - 如果$S_{\mathrm{AC}}$是
<
,那么$A$比$C$年轻;如果是>
,那么$A$比$C$年长。 - 如果$S_{\mathrm{BC}}$是
<
,那么$B$比$C$年轻;如果是>
,那么$B$比$C$年长。
谁是中间的兄弟,也就是说,三个人中第二大的那个是谁?
约束条件
- $S_{\mathrm{AB}}$、$S_{\mathrm{AC}}$、$S_{\mathrm{BC}}$每个都是
<
或>
。 - 输入不包含矛盾;也就是说,总是存在一个年龄关系能满足所有给定的不等式。
输入
输入从标准输入以下格式给出:
$S_{\mathrm{AB}}$ $S_{\mathrm{AC}}$ $S_{\mathrm{BC}}$
输出
打印中间兄弟的名字,即三个人中第二大的那个。
示例输入1
< < <
示例输出1
B
因为$A$比$B$年轻,$B$比$C$年轻,我们可以确定$C$是最年长的,$B$是中间的,$A$是最年轻的。因此,答案是B
。
示例输入2
< < >
示例输出2
C