题库练习 New Problem
← 上一题 下一题 →

A8934 | New Problem

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

Coming up with a new problem isn't as easy as many people think. Sometimes it is hard enough to name it. We'll consider a title original if it doesn't occur as a substring in any titles of recent Codeforces problems.

You've got the titles of $n$ last problems — the strings, consisting of lowercase English letters. Your task is to find the shortest original title for the new problem. If there are multiple such titles, choose the lexicographically minimum one. Note, that title of the problem can't be an empty string.

A substring $s[l...\ r]$ $(1<=l<=r<=|s|)$ of string $s=s_{1}s_{2}...\ s_{|s|}$ (where $|s|$ is the length of string $s$ ) is string $s_{l}s_{l+1}...\ s_{r}$ .

String $x=x_{1}x_{2}...\ x_{p}$ is lexicographically smaller than string $y=y_{1}y_{2}...\ y_{q}$ , if either $p<q$ and $x_{1}=y_{1},x_{2}=y_{2},...\ ,x_{p}=y_{p}$ , or there exists such number $r$ $(r<p,r<q)$ , that $x_{1}=y_{1},x_{2}=y_{2},...\ ,x_{r}=y_{r}$ and $x_{r+1}<y_{r+1}$ . The string characters are compared by their ASCII codes.

输入格式

The first line contains integer $n$ ( $1<=n<=30$ ) — the number of titles you've got to consider. Then follow $n$ problem titles, one per line. Each title only consists of lowercase English letters (specifically, it doesn't contain any spaces) and has the length from 1 to 20, inclusive.

输出格式

Print a string, consisting of lowercase English letters — the lexicographically minimum shortest original title.

输入输出样例

输入 #1
5
threehorses
goodsubstrings
secret
primematrix
beautifulyear
输出 #1
j
输入 #2
4
aa
bdefghijklmn
opqrstuvwxyz
c
输出 #2
ab
C++ 编辑器
输入
输出