#include<bits/stdc++.h>
using namespace std;
namespace IO
{
	const int buffer_size=1e5+5;
	char buf[buffer_size],*S,*T;
	bool flag_EOF;
	inline char read_char()
	{
	    if(S==T)
			T=(S=buf)+fread(buf,1,buffer_size,stdin);
	    return S!=T?*(S++):EOF;
	}
	inline int read_int()
	{
	    int flag=1;
	    char c=read_char();
	    while(c<'0'||c>'9')
	    {
	        if(c==EOF)
	        {
	            flag_EOF=true;
	            return 0;
	        }
	        flag=(c=='-'?-1:1);
	        c=read_char();
	    }
	    int x=0;
	    while(c>='0'&&c<='9')
	    {
	        x=x*10+(c^48);
	        c=read_char();
	    }
	    return x*flag;
	}
	char st[13];
	int _top;
	inline void Write(int x)
	{
		if(!x)
		{
			putchar('0');
			return;
		}
		if(x<0)
		{
			putchar('-');
			x=-x;
		}
		while(x)
		{
			st[++_top]=x%10+'0';
			x/=10;
		}
		while(_top>0)
			putchar(st[_top--]);
	}
}
const int max_n=2e5+5;
char str[15];
struct node
{
	string s;
	bool flag;
}p[max_n];
bool cmp(node x,node y)
{
	return x.s!=y.s?x.s<y.s:x.flag<y.flag;
}
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;++i)
	{
		scanf("%s",str+1);
		int len=strlen(str+1);
		if(str[1]=='!')
		{ 
			p[i].flag=true;
			for(int j=2;j<=len;++j)
				p[i].s+=str[j];
		}
		else
		{
			for(int j=1;j<=len;++j)
				p[i].s+=str[j];
		}
	}
	sort(p+1,p+n+1,cmp);
	for(int i=1;i<n;++i)
	{
		if(p[i].s==p[i+1].s&&p[i].flag!=p[i+1].flag)
		{
			cout<<p[i].s<<endl;
			return 0;
		}
	}
	puts("satisfiable");
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = (1<<30)-1;
const ll LINF = (1LL<<60)-1;

#define rep(i, n) for (int i = 0; i < n; i++)
#define sz(a) (int)(a.size())

template<class T> 
bool chmax(T &a, T b) {if (a < b) {a = b;return true;}else return false;}

template<class T> 
bool chmin(T &a, T b) {if (a > b) {a = b;return true;}else return false;}

//コーナーケースに気をつけろ！
int main() {
    int n;  cin >> n;
    vector<ll> a(n+1);
    a[1] = 1;
    for (ll x = 2; x <= n; x++) {
        ll mx = 0;
        for (ll z = 1; z * z <= x; z++) {
            if (x % z == 0) {
                chmax(mx, a[z]);
                chmax(mx, a[x/z]);
            }
        }
        a[x] = mx+1;
    }
    rep(i, n)
        cout << a[i+1] << " ";
    cout << endl;
    return 0;
}

//小数点精度
//cout << fixed << std::setprecision(15) << y << endl;