#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long int;
template<class T> void chmin(T& a, T b) { if (a > b) { a = b; } }
template<class T> void chmax(T& a, T b) { if (a < b) { a = b; } }

int main() {
  int N;
  cin >> N;

  unordered_map<string, int> mp;

  rep(i, N) {
    string S;
    cin >> S;

    if (S[0] == '!') {
      if (mp.find(S.substr(1, S.size() - 1)) != mp.end()) {
        cout << S.substr(1, S.size() - 1) << endl;
        return 0;
      } else {
        mp[S] = i;
      }
    } else {
      if (mp.find("!" + S) != mp.end()) {
        cout << S << endl;
        return 0;
      } else {
        mp[S] = i;
      }
    }
  }
  cout << "satisfiable" << endl;
}
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2e5 + 10;
const int N = 105;
const ll mod = 998244353;

int n;
string str[maxn], res;
unordered_map<string, int>o;

int main() {
#ifndef ONLINE_JUDGE
	freopen("1.txt", "r", stdin);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> n;
	res = "()";
	for (int i = 1; i <= n; ++i) {
		cin >> str[i];
		if (res != "()")continue;
		if (str[i][0] == '!') {
			string cur = "";
			int sz = str[i].size();
			for (int j = 1; j < sz; ++j) {
				cur += str[i][j];
			}
			if (o[cur] == 1) {
				res = cur;
			} else {
				o[cur] = 2;
			}
		} else {
			if (o[str[i]] == 2) {
				res = str[i];
			} else {
				o[str[i]] = 1;
			}
		}
	}
	if (res == "()")cout << "satisfiable" << endl;
	else cout << res << endl;
	return 0;
}