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

const int INF = 10000;

int num_of_gt_self_type(const int type, const int unit, const vector< vector<int> >& spc){
    int res = 0;
    int v = spc[unit][type];
    for(int i = 0; i < spc.size(); i++){
        if(v < spc[i][type]){
            res++;
        }
    }
    return res;
}

int num_of_gt_self(const vector<int>& pts){
    int res = 0;
    int v = pts[0];
    for(int i = 0; i < pts.size(); i++){
        if(v < pts[i]){
            res++;
        }
    }
    return res;
}

bool risable(const int N, const vector<int>& r, const vector< vector<int> >& spc){
    vector<int> pts(N, 0);

    for(int type = 0; type < 3; type++){
        for(int unit = 0; unit < N; unit++){
            int rank = num_of_gt_self_type(type, unit, spc);
            pts[unit] += r[rank];
        }
    }
    /*
    for(int i = 0; i < N; i++){
        cout << pts[i] << endl;
    }
    */

    return num_of_gt_self(pts) < 8;
}

int main(void){
    int N;
    vector<int> r;
    vector< vector<int> > spc;
    cin >> N;
    r = vector<int>(N);
    spc = vector< vector<int> >(N, vector<int>(3));
    for(int i = 0; i < N; i++){
        cin >> r[i];
    }
    for(int i = 0; i < N; i++){
        for(int j = 0; j < 3; j++){
            cin >> spc[i][j];
        }
    }

    int ans = INF;
    for(int type = 0; type < 3; type++){
        for(int newv = spc[0][type]; newv <= 100; newv++){
            vector< vector<int> > newspc(spc);
            newspc[0][type] = newv;
            if( risable(N, r, newspc) ){
                ans = min(ans, newv - spc[0][type]);
                break;
            }
        }
    }

    if(ans == INF){
        cout << "Saiko" << endl;
    }else{
        cout << ans << endl;
    }
}