#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <numeric>
#include <iomanip>
#include <stack>
#include <complex>
#include <functional>
#include <tuple>

using namespace std;

#define Rep(i,a,b) for(ll i = a; i < b; ++i)
#define rep(i,b) Rep(i,0,b)
#define allof(a) (a).begin(), (a).end()

using ll = long long;

constexpr int inf = 1e9 + 7;
constexpr ll infll = 1ll << 60ll;
constexpr ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

template<typename T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<typename T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

struct Person {
    int index;
    vector<int> rpc;
    vector<int> score;
    Person() {
        rpc = vector<int>(3);
        score = vector<int>(3);
    }
    int GetSum() {
        return score[0] + score[1] + score[2];
    }
};

bool Check(vector<Person> persons, int rule, const vector<int>& r) {
    int n = persons.size();
    // 順位再計算
    sort(allof(persons), [&](Person& lhs, Person& rhs) {
        return lhs.rpc[rule] > rhs.rpc[rule];
        });
    int rank = 0;
    int prev = -1;
    int add = 0;
    rep(i, n) {
        if (persons[i].rpc[rule] != prev) {
            rank += add + 1;
            add = 0;
            prev = persons[i].rpc[rule];
        }
        else {
            ++add;
        }
        persons[i].score[rule] = r[rank - 1];
    }

    sort(allof(persons), [&](Person& lhs, Person& rhs) {
        return lhs.GetSum() > rhs.GetSum();
        });

    rank = 0;
    prev = -1;
    add = 0;
    rep(i, n) {
        if (persons[i].GetSum() != prev) {
            rank += add + 1;
            add = 0;
            prev = persons[i].GetSum();
        }
        else {
            ++add;
        }
        //cout << persons[i].index << " rank : " << rank << " score : " << persons[i].GetSum() << endl;
        if (persons[i].index == 0) break;
    }
    return rank <= 8;
}

int main() {

    int n;
    cin >> n;
    vector<int> r(n);
    rep(i, n) cin >> r[i];
    vector<Person> persons(n);

    rep(i, n) {
        cin >> persons[i].rpc[0] >> persons[i].rpc[1] >> persons[i].rpc[2];
        persons[i].index = i;
    }

    int ans = inf;

    // それぞれの得点を計算
    rep(j, 3) {
        sort(allof(persons), [&](Person& lhs, Person& rhs) {
            return lhs.rpc[j] > rhs.rpc[j];
            });
        int rank = 0;
        int prev = -1;
        int add = 0;
        rep(i, n) {
            if (persons[i].rpc[j] != prev) {
                rank += add + 1;
                add = 0;
                prev = persons[i].rpc[j];
            }
            else {
                ++add;
            }
            persons[i].score[j] = r[rank - 1];
        }
    }

    // 元の順番に戻す
    sort(allof(persons), [&](Person& lhs, Person& rhs) {
        return lhs.index < rhs.index;
        });

    rep(i, 3) {
        int prev = persons[0].rpc[i];
        // 自分のスコアをこれにする
        for (int j = persons[0].rpc[i] + 1; j <= 100; ++j) {
            // これで8位以内になれるか
            persons[0].rpc[i] = j;

            if (Check(persons, i, r)) {
                chmin(ans, j - prev);
                break;
            }
        }
        // 得点を戻す
        persons[0].rpc[i] = prev;
    }

    if (ans == inf) cout << "Saiko" << endl;
    else cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3192