#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x, y, a, b, flag = 0, ans = 0x3f3f3f3f;
  cin >> n >> m >> x >> y >> a >> b;
  if ((x == n || x == 1) && (y == m || y == 1)) {
    ans = 0;
    flag = 1;
  } else {
    if (!(((x + a) > n && (x - a) < 1) || ((y + b) > m && (y - b) < 1))) {
      if ((n - x) % a == 0 && (m - y) % b == 0) {
        if ((n - x) / a % 2 == (m - y) / b % 2) {
          ans = min(ans, max((n - x) / a, (m - y) / b));
          flag = 1;
        }
      }
      if ((n - x) % a == 0 && (y - 1) % b == 0) {
        if ((n - x) / a % 2 == (y - 1) / b % 2) {
          ans = min(ans, max((n - x) / a, (y - 1) / b));
          flag = 1;
        }
      }
      if ((x - 1) % a == 0 && (y - 1) % b == 0) {
        if ((x - 1) / a % 2 == (y - 1) / b % 2) {
          ans = min(ans, max((x - 1) / a, (y - 1) / b));
          flag = 1;
        }
      }
      if ((x - 1) % a == 0 && (m - y) % b == 0) {
        if ((x - 1) / a % 2 == (m - y) / b % 2) {
          ans = min(ans, max((x - 1) / a, (m - y) / b));
          flag = 1;
        }
      }
    }
  }
  if (flag)
    cout << ans;
  else
    cout << "Poor Inna and pony!";
}
