/*  -*- coding: utf-8 -*-
 *
 * 2817.cc: Dance Now!
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 100;
const int MAX_C = 100;
const int K = 9;
const int INF = 1 << 30;

/* typedef */

template <typename T, const int MAX_N>
struct BIT {
  int n;
  T bits[MAX_N + 1];
  BIT() {}

  void init(int _n) {
    n = _n;
    //memset(bits, 0, sizeof(bits));
  }

  T sum(int x) {
    T s = 0;
    while (x > 0) {
      s += bits[x];
      x -= (x & -x);
    }
    return s;
  }

  void add(int x, T v) {
    while (x <= n) {
      bits[x] += v;
      x += (x & -x);
    }
  }
};

/* global variables */

int rs[MAX_N], ps[MAX_N][3], wps[K][3];
BIT<int,MAX_C> bits[3];

/* subroutines */

int score(int n, int mps[], int *rks = NULL) {
  int sc = 0;
  for (int j = 0; j < 3; j++) {
    int k = n - bits[j].sum(mps[j]);
    sc += rs[k];
    if (rks != NULL) rks[j] = k;
  }
  return sc;
}

/* main */

int main() {
  int n;
  scanf("%d", &n);

  for (int i = 0; i < n; i++) scanf("%d", rs + i);

  for (int j = 0; j < 3; j++) bits[j].init(MAX_C);

  for (int i = 0; i < n; i++)
    for (int j = 0; j < 3; j++) {
      scanf("%d", ps[i] + j);
      bits[j].add(ps[i][j], 1);
    }
  //for (int i = 0; i < n; i++) printf("%d ", score(n, ps[i])); putchar('\n');

  int sc0 = score(n, ps[0]);
  int m = 0;
  for (int i = 1; i < n; i++) {
    int sci = score(n, ps[i]);
    if (sci > sc0) memcpy(wps[m++], ps[i], sizeof(ps[i]));
  }
  //printf("m=%d\n", m);

  int mind = INF;
  for (int j = 0; j < 3; j++) {
    int pj = ps[0][j];
    bits[j].add(ps[0][j], -1);

    for (int d = 1; ps[0][j] < MAX_C; d++) {
      ps[0][j]++;
      bits[j].add(ps[0][j], 1);

      int rks[3];
      int sc0 = score(n, ps[0], rks);
      bool ok = false;

      for (int i = 0; i < m; i++)
	if (score(n, wps[i]) <= sc0) {
	  ok = true;
	  break;
	}

      bits[j].add(ps[0][j], -1);

      if (ok) {
	//printf("d[%d]=%d\n", j, d);
	if (mind > d) mind = d;
	break;
      }
      if (rks[j] == 0) break;
    }

    bits[j].add(pj, 1);
    ps[0][j] = pj;
  }

  if (mind >= INF) puts("Saiko");
  else printf("%d\n", mind);
  return 0;
}

