#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
inline ull Hash(const string& s){
    ull ans=0;
    for(auto c : s)
        ans=ans*26+c-'a';
    return ans;
}
string s;
int N;
set<ull> s1,s2;
inline void work(){
    for(int i=1;i<=N;i++){
        cin>>s;
        set<ull> &t1=(s[0]=='!'?s1:s2);
        set<ull> &t2=(s[0]!='!'?s1:s2);
        reverse(s.begin(),s.end());
        if( *s.rbegin()=='!' ) s.pop_back();
        ull val=Hash(s);
        if( t1.find(val)!=t1.end() ){
            reverse(s.begin(),s.end());
            cout<<s<<endl;
            return ;
        }
        else t2.insert(val);
    }
    cout<<"satisfiable"<<endl;
}
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin>>N;
    work();
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
//const ll INF = numeric_limits<ll>::max() / 4;
//const int INF = numeric_limits<int>::max() / 4;


int main() {
	// ll N;
	string S;
	cin >> S;
	vector<int> A(10,-1); // -1:x, 0:? 1:o
	for(int i = 0; i < 10; i++){
		if(S[i] == 'o') A[i] = 1;
		if(S[i] == '?') A[i] = 0;
	}
	int c = 0;
	bool f = true;
	vector<int> B(10,0);
	for(int i = 0; i < 10000; i++){
		f = true;
		fill(B.begin(),B.end(),0);
		int n = i;
		for(int j = 0; j < 4; j++){
			B[n % 10]++;
			n /= 10;
		}
		for(int j = 0; j < 10; j++){
			if(A[j] == 1){
				if(B[j] == 0) f = false;
			}else if(A[j] == -1){
				if(B[j] > 0) f = false;
			}
		}
		if(f) c++;
	}

	cout << c << endl;
	return(0);
}
