#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b);
long long cross_prod(long long ax, long long ay, long long bx, long long by,
                     long long cx, long long cy);
long long sum_digit(long long A);
long long get_mask(long long x);
class SegmentTree {
 public:
  vector<int> V;
  void init(int dim);
  int query(int start, int end, int pos, int node);
  void build(int start, int end, int node);
};
int N, M, x, y, t;
int main() {
  int i;
  cin >> N >> M;
  cin >> x;
  for (i = 0; i <= N; ++i) {
    cin >> y;
  }
  t = gcd(abs(x), abs(y));
  x /= t;
  y /= t;
  if (N > M) {
    (x * y > 0 ? cout << "Infinity" : cout << "-Infinity");
    return 0;
  } else if (N == M) {
    if (x * y < 0) cout << "-";
    if (x < 0) x = -x;
    if (y < 0) y = -y;
    cout << x << "/" << y;
    return 0;
  }
  cout << "0/1";
  return 0;
}
long long gcd(long long a, long long b) { return (b ? gcd(b, a % b) : a); }
long long cross_prod(long long ax, long long ay, long long bx, long long by,
                     long long cx, long long cy) {
  return (bx - ax) * (cy - ay) - (by - ay) * (cx - ax);
}
long long sum_digit(long long A) {
  long long sum = 0;
  do {
    sum += A % 10;
    A /= 10;
  } while (A);
  return sum;
}
long long get_mask(long long x) {
  long long mask = 0, c;
  while (x) {
    c = x % 10;
    x /= 10;
    if (c == 4 || c == 7) {
      mask = mask * 10 + c;
    }
  }
  return mask;
}
void SegmentTree::init(int dim) { V.resize((dim + 1) << 2); }
void SegmentTree::build(int start, int end, int node) {
  V[node] = end - start + 1;
  if (start == end) {
    return;
  }
  int mid;
  mid = (start + end) >> 1;
  build(start, mid, (node << 1));
  build(mid + 1, end, ((node << 1) | 1));
}
int SegmentTree::query(int start, int end, int pos, int node) {
  --V[node];
  if (start == end) return end;
  int L, R;
  L = node << 1;
  R = L | 1;
  int mid;
  mid = (start + end) >> 1;
  if (pos <= V[L]) {
    return query(start, mid, pos, L);
  } else {
    return query(mid + 1, end, pos - V[L], R);
  }
}
