// C++ program to check if three 
// points are collinear or not 
// using area of triangle. 
#include <bits/stdc++.h> 
#include <math.h> 
#include <stdlib.h> 

using namespace std; 
// function to check if point 
// collinear or not 

// Driver Code 
int main() 
{ 
	string s;cin>>s;
	int a[10]={0},p,x1,x2,x3,k=0,k1=1;
	for (int i=0;i<s.length();i++) a[s[i]-'0']++;
	if (s.length()==1) {
           if (s[0]=='8') k=1;
	}
	if (s.length()==2) {
        for (int i=10;i<=99;i++) {
		if (i%8==0) {
			int b[10]={0};
			p=i;
			x1=p%10;p=p/10;
			x2=p%10;
			b[x1]++;b[x2]++;
			if (x1==0||x2==0) continue;
			//b[x1]++;b[x2]++;b[x3]++;
			else {
				k1=1;
				for (int j=1;j<10;j++) {
					if (b[j]!=a[j]) {k1=0;break;}
				}
			}
				if (k1==1) {k=1;break;} 
			

		}
	}   
	}
	if (s.length()>=3) {
	for (int i=100;i<=999;i++) {
		if (i%8==0) {
			int b[10]={0};
			p=i;
			x1=p%10;p=p/10;
			x2=p%10;p=p/10;
			x3=p%10;
			b[x1]++;b[x2]++;b[x3]++;
			if (x1==0||x2==0||x3==0) continue;
			//b[x1]++;b[x2]++;b[x3]++;
			else {
				k1=1;
				for (int j=1;j<10;j++) {
					if (b[j]>a[j]) {k1=0;break;}
				}
			}
				if (k1==1) {k=1;break;} 
		}
	}
	}
	if (k==1) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
} 

// This code is contributed 
// by Akanksha Rai(Abby_akku) 

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define FOREACH(x, a) for (auto&(x) : (a))
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) ll(x.size())

int main() {
  ll n;
  cin >> n;
  vector<string> s(n);
  REP(i, n) { cin >> s[i]; }
  vector<map<string, bool>> mps(2);
  REP(i, n) {
    if (s[i][0] == '!') {
      ll len = SZ(s[i]);
      string sub = s[i].substr(1, len - 1);
      mps[0][sub] = true;
    } else {
      mps[1][s[i]] = true;
    }
  }

  for (auto p : mps[0]) {
    string t = p.first;
    if (mps[1][t]) {
      cout << t << endl;
      return 0;
    }
  }
  cout << "satisfiable" << endl;
}