問題一覧 > 通常問題

No.3019 YNeos

レベル : / AI推定難易度 : 124 / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 256 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 136
作問者 : 👑 loop0919 / テスター : Iroha_3856 nikoro256
お気に入りにしたユーザー ProblemId : 11934 / 自分の提出
問題文最終更新日: 2026-01-07 23:01:48
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 456 オムニバス (順位表) の他の問題:

Problem Statement

In Python3 and PyPy3, 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 Yes when $x = 0$ and No when $x = 1$.

Let us consider whether a string like this YNeos can 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もしくは右上の雲マークをクリックしてアカウントを作成してください。