#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

struct Info{
	bool operator<(const struct Info &arg) const{
		return sum_points > arg.sum_points;
	};
	void set(int arg_id,int arg_smile,int arg_pure,int arg_cool){
		id = arg_id;
		smile = arg_smile;
		pure = arg_pure;
		cool = arg_cool;
	}
	int id,smile,pure,cool,sum_points;
};

int main(){

	int N;
	scanf("%d",&N);

	int point[N];
	for(int i = 0; i < N; i++)scanf("%d",&point[i]);

	int smile[N],pure[N],cool[N];

	vector<Info> V;

	for(int i = 0; i < N; i++){
		scanf("%d %d %d",&smile[i],&pure[i],&cool[i]);

		Info info;
		info.set(i+1,smile[i],pure[i],cool[i]);
		V.push_back(info);
	}

	sort(smile,smile+N,greater<int>());
	sort(pure,pure+N,greater<int>());
	sort(cool,cool+N,greater<int>());

	int rank_smile[101],rank_pure[101],rank_cool[101];

	int pre = BIG_NUM,num = -1;

	for(int i = 0; i < N; i++){
		if(smile[i]  < pre){
			num = i;
			rank_smile[smile[i]] = num;
		}else{ //smile[i] == pre
			rank_smile[smile[i]] = num;
		}
		pre = smile[i];
	}


	pre = BIG_NUM,num = -1;
	for(int i = 0; i < N; i++){
		if(pure[i]  < pre){
			num = i;
			rank_pure[pure[i]] = num;
		}else{ //smile[i] == pre
			rank_pure[pure[i]] = num;
		}
		pre = pure[i];
	}

	pre = BIG_NUM,num = -1;
	for(int i = 0; i < N; i++){
		if(cool[i]  < pre){
			num = i;
			rank_cool[cool[i]] = num;
		}else{ //cool[i] == pre
			rank_cool[cool[i]] = num;
		}
		pre = cool[i];
	}

	for(int i = 0; i < N; i++){
		V[i].sum_points = point[rank_smile[V[i].smile]]+point[rank_pure[V[i].pure]]+point[rank_cool[V[i].cool]];
	}

	sort(V.begin(),V.end());

	int index,sum;

	for(int i = 0; i < N; i++){
		if(V[i].id == 1){
			index = i;
			sum = V[i].sum_points;
			break;
		}
	}

	int smile_loc,pure_loc,cool_loc;
	for(int i = 0; i < N; i++){
		if(smile[i] == V[index].smile){
			smile_loc = i;
			break;
		}
	}
	for(int i = 0; i < N; i++){
		if(pure[i] == V[index].pure){
			pure_loc = i;
			break;
		}
	}
	for(int i = 0; i < N; i++){
		if(cool[i] == V[index].cool){
			cool_loc = i;
			break;
		}
	}


	int up_smile = BIG_NUM,up_pure = BIG_NUM,up_cool=BIG_NUM;
	int calc_rank_smile[101],calc_rank_pure[101],calc_rank_cool[101],calc_smile[N],calc_pure[N],calc_cool[N];

	for(int i = index-1; i >= 0; i--){
		if(V[i].sum_points == sum)continue;

		for(int new_smile = V[index].smile+1; new_smile <= 100; new_smile++){

			for(int k = 0; k < N; k++){
				calc_smile[k] = smile[k];
			}
			calc_smile[smile_loc] = new_smile;
			sort(calc_smile,calc_smile+N,greater<int>());

			pre = BIG_NUM,num = -1;
			for(int k = 0; k < N; k++){
				if(calc_smile[k] < pre){
					num = k;
					calc_rank_smile[calc_smile[k]] = num;
				}else{
					calc_rank_smile[calc_smile[k]] = num;
				}
				pre = calc_smile[k];
			}

			int new_self_points = point[calc_rank_smile[new_smile]]+point[rank_pure[V[index].pure]]+point[rank_cool[V[index].cool]];
			int new_enemy_points = point[calc_rank_smile[V[i].smile]]+point[rank_pure[V[i].pure]]+point[rank_cool[V[i].cool]];

			if(new_self_points >= new_enemy_points){
				up_smile = min(up_smile,new_smile-V[index].smile);
				break;
			}
		}

		for(int new_pure = V[index].pure+1; new_pure <= 100; new_pure++){

			for(int k = 0; k < N; k++){
				calc_pure[k] = pure[k];
			}
			calc_pure[pure_loc] = new_pure;
			sort(calc_pure,calc_pure+N,greater<int>());

			pre = BIG_NUM,num = -1;
			for(int k = 0; k < N; k++){
				if(calc_pure[k] < pre){
					num = k;
					calc_rank_pure[calc_pure[k]] = num;
				}else{
					calc_rank_pure[calc_pure[k]] = num;
				}
				pre = calc_pure[k];
			}

			int new_self_points = point[rank_smile[V[index].smile]]+point[calc_rank_pure[new_pure]]+point[rank_cool[V[index].cool]];
			int new_enemy_points = point[rank_smile[V[i].smile]]+point[calc_rank_pure[V[i].pure]]+point[rank_cool[V[i].cool]];

			if(new_self_points >= new_enemy_points){
				up_pure = min(up_pure,new_pure-V[index].pure);
				break;
			}
		}

		for(int new_cool = V[index].cool+1; new_cool <= 100; new_cool++){ //??°?????????????????????

			for(int k = 0; k < N; k++){
				calc_cool[k] = cool[k];
			}
			calc_cool[cool_loc] = new_cool;
			sort(calc_cool,calc_cool+N,greater<int>());

			pre = BIG_NUM,num = -1;
			for(int k = 0; k < N; k++){
				if(calc_cool[k] < pre){
					num = k;
					calc_rank_cool[calc_cool[k]] = num;
				}else{
					calc_rank_cool[calc_cool[k]] = num;
				}
				pre = calc_cool[k];
			}

			int new_self_points = point[rank_smile[V[index].smile]]+point[rank_pure[V[index].pure]]+point[calc_rank_cool[new_cool]];
			int new_enemy_points = point[rank_smile[V[i].smile]]+point[rank_pure[V[i].pure]]+point[calc_rank_cool[V[i].cool]];

			if(new_self_points >= new_enemy_points){
				up_cool = min(up_cool,new_cool-V[index].cool);
				break;
			}
		}
	}

	int ans = min(up_smile,min(up_pure,up_cool));

	if(ans == BIG_NUM){
		printf("Saiko\n");
	}else{
		printf("%d\n",ans);
	}

	return 0;
}

Measured memory_bytes: 3252