#include <bits/stdc++.h>
#define rank asfanf
#define N 101
using namespace std;
typedef pair<int,int> P;
int n,r[N];

map<int,int> mkRank(vector<int> A){
  map<int,int> rank,tmp;
  for(int a:A) rank[-a]++;
  tmp = rank;
  
  for(auto it=rank.begin(),it2=++rank.begin();it2!=rank.end();it++,it2++)
    it2->second += it->second;

  for(P const &p:rank) rank[-p.first] = rank[p.first]-tmp[p.first];
  return rank;
}

int getScore(map<int,int> rank,int a){return r[rank[a]];}

vector<int> calcTotalScore(vector<int> a,vector<int>b,vector<int>c){
  vector<int> res(n,0);
  map<int,int> A = mkRank(a);
  map<int,int> B = mkRank(b);
  map<int,int> C = mkRank(c);
  for(int i=0;i<n;i++) res[i] = getScore(A,a[i]) + getScore(B,b[i]) + getScore(C,c[i]);
  return res;
}

int calc(vector<int> a,vector<int>b,vector<int>c){
  int ans = 1e9;
  for(int i=0;i<200;i++){
    a[0] += i;
    vector<int> total = calcTotalScore(a,b,c);
    map<int,int> rank = mkRank(total);
    //cout<<i<<" "<<rank[total[0]]<<" "<<total[0]<<endl;
    if(rank[total[0]] <= 7) ans = min(ans,i);
    a[0] -= i;
  }
  return ans;
}

int main(){
  cin>>n;
  for(int i=0;i<n;i++) cin>>r[i];
  vector<int> a(n),b(n),c(n);
  for(int i=0;i<n;i++)cin>>a[i]>>b[i]>>c[i];
  
  int ans = min(calc(a,b,c),min(calc(b,a,c),calc(c,a,b)));
  if(ans == 1e9) cout<<"Saiko"<<endl;
  else cout<<ans<<endl;
  return 0;
}