// Problem C

#include <stdio.h>
#include <iostream>
#include <vector>
#include <string.h>
#include <cassert>
#include <algorithm>
#include <set>
#include <map>
#include <math.h>
#include <queue>
#include <stack>

#define MAXN 1000
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long int ll;
typedef pair<int, int> ii;

int N;
vector<pair<pair< ll, bool>, string > > v;

int main() {
  cin >> N;
  ll P1 = 1000000007;
  ll P2 = 1000000009;
  string s1;
  for (int i=0; i<N; i++) {
    cin >> s1;
    ll x1 = 0;
    ll x2 = 0;
    if (s1[0] == '!') {
      for (int j=1; j<(int)s1.length(); j++) {
	x1 = ((x1 * 229) % P1) + s1[j] - 'a' + 1;
	x2 = ((x2 * 1187) % P2) + s1[j] - 'a' + 1;
      }
      v.pb(mp(mp(x1 * x2, false), s1));
    }
    else {
      for (int j=0; j<(int)s1.length(); j++) {
	x1 = ((x1 * 229) % P1) + s1[j] - 'a' + 1;
	x2 = ((x2 * 1187) % P2) + s1[j] - 'a' + 1;
      }
      v.pb(mp(mp(x1 * x2, true), s1));
    }
  }
  
  sort(v.begin(), v.end());
  for (int i=0; i<N-1; i++)
    if (v[i].first.first == v[i+1].first.first) {
      if (v[i].first.second && !v[i+1].first.second) {
	cout << v[i].second << endl;
	return 0;
      }
      else if (!v[i].first.second && v[i+1].first.second) {
	cout << v[i+1].second << endl;
	return 0;
      }
    }
    
      
  cout << "satisfiable" << endl;
  
  return 0;
}

#include<bits/stdc++.h>

int main(){
    using namespace std;
    unsigned long N;
    cin >> N;
    vector<unsigned long> A(N), B(N);
    for(auto&& i : A)cin >> i;
    for(auto&& i : B)cin >> i;
    priority_queue<unsigned long> pq;
    reverse(begin(A), end(A));
    unsigned long ans{0};
    for(unsigned long i{0}; i < N; ++i){
        pq.emplace(A.back());
        pq.emplace(B.back());
        A.pop_back();
        B.pop_back();
        ans += pq.top();
        pq.pop();
    }
    cout << ans << endl;
    return 0;
}