#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

template <class T>
using idx_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long
#define ull unsigned long long
#define arr array
#define vt vector
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define all(v) (v).begin(), (v).end()
#define pi acosl(-1)

//ofstream out("debug.txt");

const int MxN = 1e5, md = 1e9 + 7;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	bool sat = 0;
	int n;
	cin >> n;
	set<string> s;
	string t, r;
	for (int i = 0; i < n; ++i)
	{
		cin >> t;
		if (t[0] == '!')
		{
			if (s.count(t.substr(1)))
			{
				sat = 1;
				r = t.substr(1);
			}
		}
		else
		{
			if (s.count('!'+t))
			{
				sat = 1;
				r = t;
			}
		}
		s.insert(t);
	}
	if (sat)
		cout << r << '\n';
	else
		cout << "satisfiable\n";
}


#include <cstdio>
const int M = 1005;
int read()
{
	int x=0,f=1;char c;
	while((c=getchar())<'0' || c>'9') {if(c=='-') f=-1;}
	while(c>='0' && c<='9') {x=(x<<3)+(x<<1)+(c^48);c=getchar();}
	return x*f;
}
char s[M];int ans;
signed main()
{
    scanf("%s",s+1);
    for(int i=1;i<=12;i++)
        if(s[i]=='Z' && s[i+1]=='O' && s[i+2]=='N' && s[i+3]=='e')
            ans++;
    printf("%d\n",ans);
}
