#abc187c. C - 1-SAT

C - 1-SAT

Score : 300300 points

问题陈述

给定 NN 个字符串 S1,S2,,SNS_1, S_2, \dots, S_N。这些字符串都是由小写英文字母组成的非空字符串,在每个字符串的开头可能有一个 !
我们说一个字符串 TT 是不满足的,如果它与 S1,S2,,SNS_1, S_2, \dots, S_N 中的任意一个字符串匹配,无论我们在 TT 的开头是否添加 !
确定是否存在一个不满足的字符串。如果存在,给出这样一个字符串。

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

Given are NN strings S1,S2,,SNS_1, S_2, \dots, S_N. Each of these is a non-empty string consisting of lowercase English letters, with zero or one ! added at the beginning.
We say a string TT to be unsatisfied when it matches one of S1,S2,,SNS_1, S_2, \dots, S_N regardless of whether we add an ! at the beginning of TT.
Determine whether there exists an unsatisfied string. If so, present one such string.

Constraints

  • 1N2×1051 \le N \le 2 \times 10^5
  • 1Si101 \le |S_i| \le 10
  • SiS_i is a non-empty string consisting of lowercase English letters, with zero or one ! added at the beginning.

Input

Input is given from Standard Input in the following format:

NN

S1S_1

\vdots

SNS_N

Output

If there exists an unsatisfied string, print one such string.
If there is no unsatisfied string, print satisfiable.

Sample Input 1

6
a
!a
b
!c
d
!d

Sample Output 1

a

a matches S1S_1 as is, and it matches S2S_2 when we add an !, so it is unsatisfied. Besides that, d will also be accepted.

Sample Input 2

10
red
red
red
!orange
yellow
!blue
cyan
!green
brown
!gray

Sample Output 2

satisfiable