100 atcoder#ABC187C. [ABC187C] 1-SAT
[ABC187C] 1-SAT
Score : points
Problem Statement
Given are strings .
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 to be unsatisfied when it matches one of regardless of whether we add an !
at the beginning of .
Determine whether there exists an unsatisfied string. If so, present one such string.
Constraints
- 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:
Output
If there exists an unsatisfied string, print one such string.
If there is no unsatisfied string, print satisfiable
.
6
a
!a
b
!c
d
!d
a
a
matches as is, and it matches when we add an !
, so it is unsatisfied.
Besides that, d
will also be accepted.
10
red
red
red
!orange
yellow
!blue
cyan
!green
brown
!gray
satisfiable