#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <string>
#include <cctype>
#include <map>
#include <queue>
#include <limits>
#include <iomanip>
#include <sstream>
#include <cstdlib>
#include <locale>
#include <bitset>
#include <set>

using namespace std;

const int mod = 1000000007;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repd(i,n) for(int i = n-1; i >= 0; i--)
#define ll long long
#define P pair<int, int>

#define INF32 2147483647 //2.147483647×10^{9}:32bit整数のinf
#define INF64 9223372036854775807 //9.223372036854775807×10^{18}:64bit整数のinf

// debug methods
// usage: debug(x,y);
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0,a1,a2,a3,a4,x,...) x
#define debug_1(x1) cout<<#x1<<": "<<x1<<endl
#define debug_2(x1,x2) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<endl
#define debug_3(x1,x2,x3) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<endl
#define debug_4(x1,x2,x3,x4) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<endl
#define debug_5(x1,x2,x3,x4,x5) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<", "#x5<<": "<<x5<<endl
#ifdef _DEBUG
#define debug(...) CHOOSE((__VA_ARGS__,debug_5,debug_4,debug_3,debug_2,debug_1,~))(__VA_ARGS__)
#else
#define debug(...)
#endif

const double PI = acos(-1);

unsigned GetDigit(unsigned num) { return log10(num)+1; }

int main()
{
	int n;
	cin >> n;

	vector<string> s(n);
	set<string> stringSet;
	rep(i, n)
	{
		cin >> s[i];
		stringSet.insert(s[i]);
	}

	for (int i = 0; i < n; i++)
	{
		if(stringSet.count("!" + s[i]) > 0)
		{
			cout << s[i] << endl;
			return 0;
		}
	}

	cout << "satisfiable" << endl;
	return 0;
}
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < (int)(n); i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
using ll = long long;

int main() {
    int N; cin >> N;
    vector<ll> A(N), B(N), C(N), D(N), E(N);
    REP(i, 0, N) cin >> A[i] >> B[i] >> C[i] >> D[i] >> E[i];

    ll l = 0, h = 1e9 + 1, m;
    vector<int> bit(N);
    while (h - l > 1) {
        m = l + (h - l) / 2;
        REP(i, 0, N) {
            bit[i] = 0;
            if (m <= A[i]) bit[i] |= (1 << 4);
            if (m <= B[i]) bit[i] |= (1 << 3);
            if (m <= C[i]) bit[i] |= (1 << 2);
            if (m <= D[i]) bit[i] |= (1 << 1);
            if (m <= E[i]) bit[i] |= (1 << 0);
        }

        // vector<vector<bool>> dp(N + 1, vector<bool>(1 << 5, false));
        // dp[0][0] = true;
        // REP(i, 0, N) {
        //     REP(j, 0, 1 << 5) {
        //         if (!dp[i][j]) continue;
        //         dp[i + 1][j] = true;
        //         dp[i + 1][j | bit[i]] = true;
        //     }
        // }

        vector<vector<vector<bool>>> dp(N + 1, vector<vector<bool>>(1 << 5, vector<bool>(4, false)));
        dp[0][0][0] = true;
        REP(i, 0, N) {
            REP(j, 0, 1 << 5) {
                REP(k, 0, 4) {
                    if (!dp[i][j][k]) continue;
                    dp[i + 1][j][k] = true;
                    if (k < 3) dp[i + 1][j | bit[i]][k + 1] = true;
                }
            }
        }

        if (dp[N][(1 << 5) - 1][3]) l = m;
        else h = m;
    }
    cout << l << endl;
    return 0;
}
