#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  int i, n, m, x, y, g;
  cin >> n >> m >> x;
  for (i = -1; i < n; i++) {
    cin >> y;
  }
  g = gcd(x, y);
  x /= g;
  y /= g;
  if (n > m)
    x* y > 0 ? cout << "Infinity" : cout << "-Infinity";
  else if (n == m) {
    if (x * y < 0) cout << "-";
    if (x < 0) x = -x;
    if (y < 0) y = -y;
    cout << x << "/" << y;
  } else
    cout << "0/1";
  return 0;
}
