#include<bits/stdc++.h>
using namespace std;
//type
typedef long long ll;
#define pii pair<int, int>
#define vi vector<int>
//x * y * 1.0 can cause overflow
//constant
#define inf (int)(1e9+7)
#define mod (ll)(1e9+7)
#define eps 1e-10
//omission
#define eb emplace_back
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define all(v) v.begin(), v.end()
#define ios cin.tie(0); ios::sync_with_stdio(false)
#define FIX(a) cout << fixed << setprecision(a)
//manip
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define UNIQUE(v) v.erase(unique(v.begin(), v.end(), v.end());
#define fill(x, y) memset(x, y, sizeof(x))
#define ceil(a, b) a / b + !!(a % b)
template<class T> T power(T a, T b)
{return b ? power(a * a % inf, b / 2) * (b % 2 ? a : 1) % inf : 1;}
#define LB(v, x) (int)(lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (int)(upper_bound(v.begin(), v.end(), x) - v.begin())
template<typename T> T gcd(T a, T b) {if (b == 0) return a; return gcd(b, a % b);}
template<typename T> T lcm(T a, T b) {return a / gcd(max(a, b), min(a, b)) * b;} //先に割る!!
#define outa(a, n) rep(i, n) cout << a[i] << " "; cout << endl
#define out(a) cout << a << endl
//loop
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep3(i, st, n) for (int i = st; i < n; ++i)
//algorithm
//double pointer, l start, how many adds, can be 0 -> init r = l, sum = 0
//bfs, not x, y, i, j
//not !(i % 2), i % 2 == 0
//minimal required terms
//cast caution
//look constraints always




bool comp(pair<pii, pii> a, pair<pii, pii> b) {return a.F.S > b.F.S;}
bool comp2(pair<pii, pii> a, pair<pii, pii> b) {return a.S.F > b.S.F;}
bool comp3(pair<pii, pii> a, pair<pii, pii> b) {return a.S.S > b.S.S;}
int point[100];
vector<pair<pii, pii> > v;
int r[100];
int n;





int makepoint() {
    fill_n(point, n, 0);
    
    sort(all(v), comp);
    
    int now = 0;
    int tmp = 0;
    rep(i, n) {
        if (i && v[i].F.S != v[i - 1].F.S) {now += tmp; tmp = 1;}
        else tmp++;
        point[v[i].F.F] += r[now];
        
    }
    
    
    
    
    
    
    now = 0;
    tmp = 0;
    sort(all(v), comp2);
    rep(i, n) {
        if (i && v[i].S.F != v[i - 1].S.F) {now += tmp; tmp = 1;}
        else tmp++;
        point[v[i].F.F] += r[now];
        
    }
    
    
    now = 0;
    tmp = 0;
    sort(all(v), comp3);
    rep(i, n) {
        if (i && v[i].S.S != v[i - 1].S.S) {now += tmp; tmp = 1;}
        else tmp++;
        point[v[i].F.F] += r[now];
        
    }
    
    
    
    tmp = point[0];
    int sum = 0; //9位か
    rep3(i, 1, n) {
        if (point[i] > tmp) {
            sum++;
        }
    }
    if (sum < 8) return 1;
    return 0; //9位
}






int main() {
    ios;
    
    cin >> n;
    rep(i, n) cin >> r[i];
    
    
    rep(i, n) {
        int s, p, c; cin >> s >> p >> c;
        v.eb(pii(i, s), pii(p, c));
    }
    
    
    
    makepoint();
    //outa(point, n);
    //3通り大きくしてそのうち最善のもの
    //makepoint();
    //outa(point, n);
    int ans = inf;
    
    
    rep3(i, 1, 100) {
        rep(j, n) {
            if (v[j].F.F == 0) {
                v[j].F.S++;
                
                break;
            }
        }
        
        if (makepoint()) {
            ans = i;
            rep(j, n) {
                if (v[j].F.F == 0) {
                    v[j].F.S -= i;
                }
            }
            break;
        }
        if (i == 99) {
            rep(j, n) {
                if (v[j].F.F == 0) {
                    v[j].F.S-= i;
                }
            }
        }
    }
    /*
    rep(j, n) {
        if (v[j].F.F == 0) {
            cout << v[j].F.S << " " << v[j].S.F << " " << v[j].S.S << endl;
        }
    }
    */
    rep3(i, 1, 100) {
        rep(j, n) {
            if (v[j].F.F == 0) {
                v[j].S.F++;
                
                break;
            }
        }
        
        if (makepoint()) {
            chmin(ans, i);
            rep(j, n) {
                if (v[j].F.F == 0) {
                    v[j].S.F -= i;
                }
            }
            break;
        }
        //break;
        if (i == 99) {
            rep(j, n) {
                if (v[j].F.F == 0) {
                    v[j].S.F -= i;
                }
            }
        }
    }
    /*
    rep(j, n) {
        if (v[j].F.F == 0) {
            cout << v[j].F.S << " " << v[j].S.F << " " << v[j].S.S << endl;
        }
    }*/
   
    
    rep3(i, 1, 100) {
        rep(j, n) {
            if (v[j].F.F == 0) {
                v[j].S.S++;
                
                break;
            }
        }
        
        if (makepoint()) {
            chmin(ans, i);
            rep(j, n) {
                if (v[j].F.F == 0) {
                    v[j].S.S -= i;
                }
            }
            break;
        }
        //break;
        
    }
    /*
    rep(j, n) {
        if (v[j].F.F == 0) {
            cout << v[j].F.S << " " << v[j].S.F << " " << v[j].S.S << endl;
        }
    }
    */
    
    
    
    
    if (ans == inf) out("Saiko");
    else out(ans);
}

/*
 8位になるまで上げる
 3種類試す
 
 点数は高々100点
 全探索
 
 
 */



Measured memory_bytes: 3232