#include<iostream>
#include<vector>
#include<algorithm>
#include<cassert>
using namespace std;

typedef long long ll;
const ll a_max = 100;
const int snow_id = 0;

inline vector<int> getRank(const vector<ll> &a){
  int n = a.size();
  vector< pair<ll,int> > sorted(n);
  for(int i=0;i<n;i++){
    sorted[i] = make_pair(a[i], i);
  }
  sort(sorted.begin(), sorted.end(), greater< pair<ll,int> >());

  vector<int> rank(n,0);
  for(int i=0;i<n;i++){
    int id = sorted[i].second;
    rank[id] = i;
    if(i>0){
      int prv_id = sorted[i-1].second;
      if(a[id] == a[prv_id]) rank[id] = rank[prv_id];
    }
  }
  return rank;
}

inline vector<int> getTotalRank(const vector<ll> &p,
                                const vector<ll> &a, const vector<ll> &b, const vector<ll> &c){
  int n = p.size();

  vector<ll> score(n,0);
  vector<int> rank_a = getRank(a);
  for(int i=0;i<n;i++) score[i] += p[rank_a[i]];
  vector<int> rank_b = getRank(b);
  for(int i=0;i<n;i++) score[i] += p[rank_b[i]];
  vector<int> rank_c = getRank(c);
  for(int i=0;i<n;i++) score[i] += p[rank_c[i]];

  return getRank(score);
}

int main(){
  ll n;
  cin >> n;
  vector<ll> p(n);
  for(int i=0;i<n;i++) cin >> p[i];

  vector<ll> a(n), b(n), c(n);
  for(int i=0;i<n;i++){
    cin >> a[i] >> b[i] >> c[i];
  }

  assert(getTotalRank(p, a, b, c)[snow_id] == 8);

  for(int x=0; x<=a_max+1; x++){
    a[snow_id] += x;
    if(getTotalRank(p, a, b, c)[snow_id] < 8){
      cout << x << endl; return 0;
    }
    a[snow_id] -= x;

    b[snow_id] += x;
    if(getTotalRank(p, a, b, c)[snow_id] < 8){
      cout << x << endl; return 0;
    }
    b[snow_id] -= x;

    c[snow_id] += x;
    if(getTotalRank(p, a, b, c)[snow_id] < 8){
      cout << x << endl; return 0;
    }
    c[snow_id] -= x;
  }

  cout << "Saiko" << endl;
}

