#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n" 
#define mod 1000000007
#define rep(i,n) for(int i=0;i<n;i++)


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
     ll n;
   // cin >> tt;
  // while(tt--){
    cin>>n;
    string s,ans,t;
    map<string,int>m;
    int i;
    for( i=0;i<n;i++){
        cin>>s;
        if(s[0]=='!'){
            t=s;
            t.erase(t.begin());
            if(m[t]>=1){
                ans=t;
                break;
        }
        }
        else{
            t=s;
            t.insert(t.begin(),'!');
            if(m[t]>=1){
                ans=t;
                  t.erase(t.begin());
                break;
        } 
        }
        m[s]++;      
    }
    if(i==n)
    cout<<"satisfiable"<<endl;
    else{
        cout<<t;
    }
   // }
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

// Big two primes
#define X 1001100011100001111ll
#define mod 1000000007
#define int long long
#define ll long long
#define all(a) a.begin(),a.end()
#define sortall(a) sort(all(a))
#define fo(i, n) for (int i = 0; i < n; i++)
#define fo1(i, n) for (int i = 1; i <= n; i++)
#define loop(i,a,b) for (int i = a; i < b; i++)
#define nloop(i,a,b) for (int i = a ; i>=b;i--)
#define tc(t) int t; cin >> t; while (t--)
#define arrip(a,n)  int a[n]; fo(i, n) cin >> a[i];
#define arrop(a,n)  fo(i,n) cout<<a[i]<<" ";
#define pb push_back
#define mp make_pair
#define itr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626

#define fio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define rr return 0
#define prec(n) fixed<<setprecision(n)
#define maxpq priority_queue<int>
#define minpq priority_queue<int, vector<int>, greater<int> >
#define inf (int)(1e18)
#define ini(a, i) memset(a, i, sizeof(a))
#define vi vector<int>
#define fi first
#define se second
#define endl "\n"
#define pi pair<int, int>
#define vpi vector<pi>
#define sz(s) s.size()
#define bits(n) __builtin_popcount(n)
//const int MAXN = (int)((1e5) +` 100);
int gcd(int a, int b) { if (a == 0) return b; return gcd(b % a, a);}
int max(int a, int b) {if (a > b) return a; else return b;}
int min(int a, int b) {if (a < b) return a; else return b;}


int maxSubArraySum(int a[], int size)
{
	int max_so_far = a[0];
	int curr_max = a[0];

	for (int i = 1; i < size; i++)
	{
		curr_max = max(a[i], curr_max + a[i]);
		max_so_far = max(max_so_far, curr_max);
	}
	return max_so_far;
}
int32_t main()
{

	fio;

#ifndef ONLINE_JUDGE
	freopen("ai.txt", "r", stdin);
	freopen("ao.txt", "w", stdout);
#endif

	int n;
	cin >> n;

	arrip(a, n);
	arrip(b, n);

	int c[n];

	c[0] = a[0] * b[0];
	int maxi = a[0];

	for (int i = 1; i < n; i++) {

		maxi = max(a[i], maxi);

		c[i] = max(max(c[i - 1], a[i] * b[i]), maxi * b[i]);
	}

	fo(i, n) {
		cout << c[i] << endl;
	}
}