#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
typedef pair<int, int> pii;

int main(){
    int n;
    cin >> n;
    vector<int> r(n);
    for(int i=0; i<n; i++){
        cin >> r[i];
    }
    vector<vector<int>> p(3, vector<int>(n));
    for(int i=0; i<n; i++){
        for(int j=0; j<3; j++){
            cin >> p[j][i];
        }
    }
    for(int d=0; d<=101; d++){
        for(int k=0; k<3; k++){
            vector<vector<pii>> pp(3, vector<pii>(n));
            for(int i=0; i<3; i++){
                for(int j=0; j<n; j++){
                    int add = (k==i and j==0)? d: 0;
                    pp[i][j] = pii(p[i][j]+add, j);
                }
                sort(pp[i].begin(), pp[i].end(), greater<pii>());
            }
            vector<pii> score(n);
            for(int i=0; i<n; i++){
                score[i] = pii(0, i);
            }
            for(int i=0; i<3; i++){
                for(int j=0; j<n; j++){
                    int s = r[j];
                    score[pp[i][j].second].first += s;
                    while(j<n-1 and pp[i][j].first==pp[i][j+1].first){
                        j++;
                        score[pp[i][j].second].first += s;
                    }
                }
            }
            sort(score.begin(), score.end(), greater<pii>());
            vector<int> ord(n);
            for(int i=0; i<n; i++){
                int curr = i;
                ord[score[i].second] = curr; 
                while(i<n-1 and score[i].first==score[i+1].first){
                    i++;
                    ord[score[i].second] = curr;
                }
            }
            if(ord[0] < 8){
                cout << d << endl;
                return 0;
            }
        }
    }
    cout << "Saiko" << endl;
    return 0;
}

