#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, t, j, n, m, a, b, k, f[4][2];
  cin >> n >> m >> i >> j >> a >> b;
  f[0][0] = i - 1, f[0][1] = j - 1;
  f[1][0] = i - 1, f[1][1] = m - j;
  f[2][0] = n - i, f[2][1] = j - 1;
  f[3][0] = n - i, f[3][1] = m - j;
  int mi = 100000000;
  t = 0;
  for (k = 0; k < 4; k++) {
    i = f[k][0], j = f[k][1];
    if (i == 0 && j == 0) {
      cout << "0" << endl;
      return 0;
    }
    if (i % a || j % b || (i / a) % 2 != (j / b) % 2 || (i == 0 && a >= n) ||
        (j == 0 && b >= m))
      ;
    else {
      t = 1;
      mi = min(mi, max(j / b, i / a));
    }
  }
  if (t)
    cout << mi << endl;
  else
    cout << "Poor Inna and pony!" << endl;
  return 0;
}
