/*Allah Vorosha*/
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define ull unsigned long long
#define pb push_back
#define n_p next_permutation
#define p_p prev_permutation
#define in insert
#define rev reverse
#define pf push_front
#define pob pop_back
#define uniq(v)         v.resize(distance(v.begin(),unique(v.begin(),v.end())))
#define all(x) (x).begin(),(x).end()
#define pof pop_front
#define ios ios_base::sync_with_stdio(0);cin.tie();cout.tie();
#define scn scanf
#define prt printf
#define rep(i, a, n) for(int i = a; i < n; i++)
#define mod 1000000007
#define yes cout << "YES\n"
#define no cout << "NO\n";
#define take for(auto &it : a) cin >> it;
#define out cout << a << "\n";
#define l_b lower_bound
#define u_b upper_bound
#define Max 100005
template<typename T> T mymax(T x, T y) {
    return (x > y ? x : y);
}

using namespace std;

const int N = 1000005;
int c = 1;

void solve() {
    int n;
    cin >> n;
    string s[n];
    map<string, int> mp;
    for(int i = 0; i < n; i++) {
        cin >> s[i];
        if(s[i][0] == '!') continue;
        mp[s[i]]++;
    }
    for(int i = 0; i < n; i++) {
        if(s[i][0] == '!') {
            string t = s[i];
            t.erase(t.begin());
            if(!mp[t]) continue;
            cout << t << '\n';
            return;
        }
    }
    cout << "satisfiable\n";
}

int main() {
    /*int tc;
    cin >> tc;
    while(tc--)*/
    solve();
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
map<string, int> m;
int main(){
  int n;
  cin >> n;
  string ans = "satisfiable";
  for(int i = 0; i < n; i++){
    char a[20];
    cin >> a;
    if(a[0] == '!'){
      if(m[a+1] == 1){
        ans = a+1;
      }
      else{
        m[a+1] = 2;
      }
    }
    else{
      if(m[a] == 2){
        ans = a;
      }
      else{
        m[a] = 1;
      }
    }
  }
  cout << ans << '\n';
  
}