問題一覧 > 教育的問題

No.2268 Avoiding NG Words

レベル : / AI推定難易度 : 450 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (AC するまで非表示) / 解いたユーザー数 93
作問者 : 👑 p-adic / テスター : Moss_Local
お気に入りにしたユーザー ProblemId : 9224 / 自分の提出
問題文最終更新日: 2023-04-14 21:33:20
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 384 (順位表) の他の問題:

Problem Statement

The input gives a positive integer $N$ and $N$ strings of length $N$ consisting only of the $2$ kinds of characters a and b. These $N$ strings are called NG words.

 

Find one string of length $N$ consisting only of a and b that is not an NG word.

It can be proved that such a string always exists.

Input

The input is given from standard input in $1 + N$ lines in the following format.

  • Line $1$ contains $N$.
  • For each positive integer $n$ not exceeding $N$, line $1 + n$ contains the $n$-th NG word.

Constraints

The input satisfies the following constraints:

  • $N$ is an integer satisfying $1 \leq N \leq 10^3$
  • Each NG word is a string of length $N$ consisting only of a and b

Output

Output one string of length $N$ consisting only of a and b that is not an NG word.

This is a special judge problem. There may be more than one correct answer, but output only one of them.

Print a newline at the end.

Sample

Sample 1
Input
1
a
Output
b

The only NG word is a. Therefore, b is not an NG word. There are no other correct answers.

Sample 2
Input
2
ab
ba
Output
aa

The only NG words are ab and ba. Therefore, aa is not an NG word. Besides this, bb is also a correct answer. There are no other correct answers.

Sample 3
Input
3
aaa
bbb
aaa

NG words may be duplicated, as in this case.

Output
aba

The only NG words are aaa and bbb. Therefore, aba is not an NG word. Besides this, strings such as abb are also correct answers.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。