#1030
Unrated
ABECEDA
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Author: Luka Kalinovčić

A list of words written in some unknown alphabet was found. It is known, however, that these words are in alphabetic order. Write a program that will find the unique alphabetic ordering of used letters, or determine that no such ordering exists or that there is more than one possible solution.

입력

The first line of input contains a positive integer N (N ≤ 100), the number of words. The following N lines contain the list of words found, one word per line. Each word consists of at most 10 lowercase letters.

출력

The first and only line of output should contain all letters in alphabetic order. If no such ordering exists, output ‘!’. If there is more than one solution, output ‘?’.

예제 입력 1

5
ula
uka
klua
kula
al

예제 출력 1

luka

예제 입력 2

4
jaja
baba
baja
beba

예제 출력 2

!

예제 입력 3

3
marko
darko
zarko

예제 출력 3

?
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.