No.3019 YNeos
タグ : / 解いたユーザー数 136
作問者 : 👑
Iroha_3856
nikoro256
Problem Statement
In
Python3andPyPy3, the following code is sometimes written in code golf (the practice of getting AC with as short a code as possible).print("YNeos"[x::2])This code prints
Yeswhen $x = 0$ andNowhen $x = 1$.Let us consider whether a string like this
YNeoscan be applied to other output formats as well.
You are given strings $X, Y$ consisting of uppercase and lowercase English letters.
Determine whether there exists a string $S$ consisting of uppercase and lowercase English letters that satisfies the following conditions, and if it exists, print that $S$.
If it does not exist, print a $?$ mark (?).
- The string obtained by extracting the odd-positioned characters of $S$ and concatenating them in their original order is $X$.
- The string obtained by extracting the even-positioned characters of $S$ and concatenating them in their original order is $Y$.
Constraints
- $X, Y$ are strings consisting of uppercase and lowercase English letters
- $1 \leq |X|, |Y| \leq 100$ ($|X|, |Y|$ are the lengths of $X, Y$, respectively)
Input
The input is given from standard input in the following format.
$X$ $Y$
Output
If there exists an $S$ satisfying the conditions in the problem statement, print that $S$.
If it does not exist, print a $?$ mark (?).
Sample
Sample 1
Input
Yes No
Output
YNeos
Extracting the odd-positioned characters of YNeos gives Yes, and extracting the even-positioned characters gives No.
Sample 2
Input
Takahashi Aoki
Output
?
No $S$ satisfying the conditions exists. In this case, print ?.
Sample 3
Input
Alice Bruno
Output
ABlriucneo
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。