#include <bits/stdc++.h>
using namespace std;
long long gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
long long lcm(long long x, long long y) { return (x * y) / gcd(x, y); }
int main() {
  int n;
  cin >> n;
  vector<vector<int>> f(n, vector<int>(10, 0));
  vector<vector<int>> p(n, vector<int>(11, 0));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 10; j++) {
      cin >> f[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 11; j++) {
      cin >> p[i][j];
    }
  }
  long long ans = -(long long)1000000007 * 10;
  cout << ans << endl;
}
