#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, x1, y1, a, b, ans = INT_MAX;
  cin >> y >> x >> y1 >> x1 >> b >> a;
  if ((x1 - 1) % a == 0 && (y1 - 1) % b == 0) {
    int t1 = (x1 - 1) / a;
    int t2 = (y1 - 1) / b;
    if (x1 == 1 && y1 == 1)
      ans = 0;
    else if (t1 < t2) {
      int t3 = (y1 - 1) - b * t1;
      if (t3 % (2 * b) == 0 && 1 + a <= x) ans = min(ans, t2);
    } else {
      int t3 = (x1 - 1) - a * t2;
      if (t3 % (2 * a) == 0 && 1 + b <= y) ans = min(ans, t1);
    }
  }
  if ((x - x1) % a == 0 && (y1 - 1) % b == 0) {
    int t1 = (x - x1) / a;
    int t2 = (y1 - 1) / b;
    if (x1 == x && y1 == 1)
      ans = 0;
    else if (t1 < t2) {
      int t3 = (y1 - 1) - b * t1;
      if (t3 % (2 * b) == 0 && x - a > 0) ans = min(ans, t2);
    } else {
      int t3 = (x - x1) - a * t2;
      if (t3 % (2 * a) == 0 && 1 + b <= y) ans = min(ans, t1);
    }
  }
  if ((x1 - 1) % a == 0 && (y - y1) % b == 0) {
    int t1 = (x1 - 1) / a;
    int t2 = (y - y1) / b;
    if (x1 == 1 && y1 == y)
      ans = 0;
    else if (t1 < t2) {
      int t3 = (y - y1) - b * t1;
      if (t3 % (2 * b) == 0 && 1 + a <= x) ans = min(ans, t2);
    } else {
      int t3 = (x1 - 1) - a * t2;
      if (t3 % (2 * a) == 0 && y - b > 0) ans = min(ans, t1);
    }
  }
  if ((x - x1) % a == 0 && (y - y1) % b == 0) {
    int t1 = (x - x1) / a;
    int t2 = (y - y1) / b;
    if (x1 == x && y1 == y)
      ans = 0;
    else if (t1 < t2) {
      int t3 = (y - y1) - b * t1;
      if (t3 % (2 * b) == 0 && x - a > 0) ans = min(ans, t2);
    } else {
      int t3 = (x - x1) - a * t2;
      if (t3 % (2 * a) == 0 && y - b > 0) ans = min(ans, t1);
    }
  }
  if (ans == INT_MAX)
    cout << "Poor Inna and pony!\n";
  else
    cout << ans << endl;
}
