#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define ll long long
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<long long>;
using vvll = vector<vll>;

//snippets:tmp,cl,cvl,cs,co,coy,con,cov,setp

int main(){
    ll n;
    cin >> n;
    vll r(n);
    rep(i, n) cin >> r[i];
    vector<pair<ll,ll>> s(n);
    vector<pair<ll,ll>> p(n);
    vector<pair<ll,ll>> c(n);
    rep(i,n){
        ll si,pi,ci;
        cin>>si>>pi>>ci;
        s[i].first=si;
        s[i].second=i;
        p[i].first=pi;
        p[i].second=i;
        c[i].first=ci;
        c[i].second=i;
    }
    vector<pair<ll,ll>> ss(n);
    vector<pair<ll,ll>> pp(n);
    vector<pair<ll,ll>> cc(n);
    ss=s;
    pp=p;
    cc=c;
    sort(rall(p));
    sort(rall(c));

    ll mini=1000;
    rep(j,101){
        vll sco(n,0);
        s=ss;
        s[0].first+=j+1;
        sort(rall(s));
        ll cos=0;
        ll cop=0;
        ll coc=0;
        rep(i,n){
            if(i!=0){
                if(s[i-1].first==s[i].first){
                    cos++;
                    sco[s[i].second]+=r[i-cos];
                }else{
                    sco[s[i].second]+=r[i];
                    cos=0;
                }
                if(p[i-1].first==p[i].first){
                    cop++;
                    sco[p[i].second]+=r[i-cop];
                }else{
                    sco[p[i].second]+=r[i];
                    cop=0;
                }
                if(c[i-1].first==c[i].first){
                    coc++;
                    sco[c[i].second]+=r[i-coc];
                }else{
                    sco[c[i].second]+=r[i];
                    coc=0;
                }
            }else{
                sco[s[i].second]+=r[i];
                sco[p[i].second]+=r[i];
                sco[c[i].second]+=r[i];
            }
        }
        ll sc=sco[0];
        sort(rall(sco));
        if(sco[7]<=sc){
            if(mini>j) mini=j;
            break;
        }
    }
    s=ss;
    c=cc;
    sort(rall(s));
    sort(rall(c));
    rep(j,101){
        vll sco1(n,0);
        p=pp;
        p[0].first+=j+1;
        sort(rall(p));
        ll cos=0;
        ll cop=0;
        ll coc=0;
        rep(i,n){
            if(i!=0){
                if(s[i-1].first==s[i].first){
                    cos++;
                    sco1[s[i].second]+=r[i-cos];
                }else{
                    sco1[s[i].second]+=r[i];
                    cos=0;
                }
                if(p[i-1].first==p[i].first){
                    cop++;
                    sco1[p[i].second]+=r[i-cop];
                }else{
                    sco1[p[i].second]+=r[i];
                    cop=0;
                }
                if(c[i-1].first==c[i].first){
                    coc++;
                    sco1[c[i].second]+=r[i-coc];
                }else{
                    sco1[c[i].second]+=r[i];
                    coc=0;
                }
            }else{
                sco1[s[i].second]+=r[i];
                sco1[p[i].second]+=r[i];
                sco1[c[i].second]+=r[i];
            }
        }
        ll sc1=sco1[0];
        sort(rall(sco1));
        if(sco1[7]<=sc1){
            if(mini>j) mini=j;
            break;
        }
    }
    s=ss;
    p=pp;
    sort(rall(p));
    sort(rall(s));
    rep(j,101){
        vll sco2(n,0);
        c=cc;
        c[0].first+=j+1;
        sort(rall(c));
        ll cos=0;
        ll cop=0;
        ll coc=0;
        rep(i,n){
            if(i!=0){
                if(s[i-1].first==s[i].first){
                    cos++;
                    sco2[s[i].second]+=r[i-cos];
                }else{
                    sco2[s[i].second]+=r[i];
                    cos=0;
                }
                if(p[i-1].first==p[i].first){
                    cop++;
                    sco2[p[i].second]+=r[i-cop];
                }else{
                    sco2[p[i].second]+=r[i];
                    cop=0;
                }
                if(c[i-1].first==c[i].first){
                    coc++;
                    sco2[c[i].second]+=r[i-coc];
                }else{
                    sco2[c[i].second]+=r[i];
                    coc=0;
                }
            }else{
                sco2[s[i].second]+=r[i];
                sco2[p[i].second]+=r[i];
                sco2[c[i].second]+=r[i];
            }
        }
        ll sc2=sco2[0];
        sort(rall(sco2));
        if(sco2[7]<=sc2){
            if(mini>j) mini=j;
            break;
        }
    }
    if(mini!=1000)cout << mini+1 << endl;
    else cout<<"Saiko"<<endl;
}


Measured memory_bytes: 3104