#include<bits/stdc++.h>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MAX 9999999
#define N 105
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
 
int n,d[3][N],point[3][N],r[N];
 
void cal(int x){
  for(int i=0;i<n;i++){
    int cnt=0;
    for(int j=0;j<n;j++){
      if(d[x][i]<d[x][j]){
	cnt++;
      }
    }
    point[x][i]=r[cnt];
  }
}
int a[N],sum[N];
 
int check(int x){
  for(int i=1;i<=100;i++){
    d[x][0]++;
    for(int j=0;j<n;j++){
      int cnt=0;
      for(int k=0;k<n;k++){
	if(d[x][j]<d[x][k]){
	  cnt++;
	}
      }
      a[j]=r[cnt];
    }
    memset(sum,0,sizeof(sum));
    for(int j=0;j<n;j++)
      for(int k=0;k<3;k++){
	if(k==x)sum[j]+=a[j];
	else sum[j]+=point[k][j];
      }
    int cnt=0;
    for(int j=0;j<n;j++)
      if(sum[0]<sum[j])cnt++;
    if(cnt+1<=8)return i;
  }
  return INF;
}
 
int main(){
  cin>>n;
  rep(i,n) cin>>r[i];
  rep(i,n) cin>>d[0][i]>>d[1][i]>>d[2][i];
  
  rep(i,3)cal(i);
     
  int ans=INF;
  rep(i,3)ans=min(ans,check(i));
  if(ans!=INF)cout<<ans<<endl;
  else cout<<"Saiko"<<endl;
  return 0;
}