/*GIVE ME AC!!!!!!*/
#include<bits/stdc++.h>
#define ll long long
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int main() {
  int n;
   cin>>n;
  vector<pair<string,int>>v(n);
  rep(i,n){
    string t;
    cin>>t;
    if(t[0]=='!'){
     t.erase(0,1);
      v[i]=make_pair(t,1);
    }
    else{
       v[i]=make_pair(t,0);
    }
  }
   sort(v.begin(),v.end());
   int ans=0;
  rep(i,n-1){
      if(get<0>(v[i])==get<0>(v[i+1])&&((get<1>(v[i])==1&&get<1>(v[i+1])==0)||(get<1>(v[i])==0&&get<1>(v[i+1])==1))){
        ans++;
        cout<<get<0>(v[i])<<endl;
        break;
      }
  }
  if(ans==0){
    cout<<"satisfiable"<<endl;
  }
}
#include <bits/stdc++.h>
using namespace std;

int N;
string S[200000];
map<string, int> str;

int main() {
    scanf("%d", &N);
    for (int i = 0;i < N;i++) {
        cin >> S[i];
        str[S[i]] = 0;
    }
    for (int i = 0;i < N;i++) {
        if (S[i][0] != '!') {
            str[S[i]] = 1;
        }
    }
    for (int i = 0;i < N;i++) {
        if (S[i][0] == '!' && str[S[i].substr(1)] == 1) {
            str[S[i].substr(1)] = 2;
        }
    }
    string ans = "satisfiable";
    for (int i = 0;i < N;i++) {
        if (S[i][0] != '!') {
            if (str[S[i]] == 2) {
                ans = S[i];
                break;
            }
        }
    }
    printf("%s\n", ans.c_str());
    return 0;
}