#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	bool flag=false;
	string ans;
	map<string , bool > mp;
	for(int i=0;i<n;i++)
	{
		string s;
		cin>>s;
		if(s[0]=='!')
		{
		   string r=s;
		   mp[s]=true;
		   int n=s.size();
		r=r.substr(1,n-1);
		   if(mp.find(r)!=mp.end())
		   {
			 flag=true;
			 ans=r;
		}
		   
		} 
		else
		{ 
		  	 
		  	 string r=s;
		  	 mp[s]=true;
		  	 reverse(r.begin(),r.end());
		  	 r.push_back('!');
		  	 reverse(r.begin(),r.end());
		  	 if(mp.find(r)!=mp.end()) {
			   flag=true;
			   ans=s;
		}
		}
	}
	if(flag) cout<<ans<<endl;
	else cout<<"satisfiable"<<endl;
}

#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <complex>
#include <vector>
#include <limits>
#include <iomanip>
#include <cassert>
#include <numeric>
#include <chrono>
#include <random>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define debug(x) cerr << #x << " = " << (x) << endl;
#define debug_pii(x) cerr << "(" << x.first << "," << x.second << ")";
#define rep(i, n) for(int i = 0;i < n;i++)
#define repr(i, n) for(int i = n-1;i >= 0;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second

const long double pi = 3.141592653589793;
const int mod = 1e9 + 7;


void solve() {
  unordered_set<string> us1, us2;
  int n;string s;cin>>n;
  rep(i,n) {
    cin>>s;
    if(s[0] == '!') {
      s.erase(s.begin());
      us2.insert(s);
    } else {
      us1.insert(s);
    }
  }
  for(auto x : us1) {
    if(us2.count(x) == 1) {
      cout << x << endl;
      return;
    }
  }
  cout << "satisfiable\n";
}

int main() {

 // freopen("input.in","r",stdin);
 // freopen("output.out","w",stdout);
 // cout << fixed << setprecision(15);
 ios_base::sync_with_stdio(false);
 cin.tie(nullptr);
 int t = 1;
 // cin >> t;
 while (t--) {
   solve();
 }

 return 0;
}
