#include <bits/stdc++.h>
using namespace std;
int s[999][999];
int c;
int main() {
  int a, b;
  cin >> a >> b;
  for (int j = 0; j < a + b; j++)
    for (int i = 0; i < 3; i++) {
      cin >> c;
      s[i][j] = c;
    }
  cout << "INF";
  return 0;
}
