#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
long long n, m, i, j, a, b;
bool canMoveX, canMoveY;
long long abss(long long x) {
  if (x < 0) return -x;
  return x;
}
long long go(long long x, long long y) {
  long long A = abss(x - i);
  long long B = abss(y - j);
  if (A % a != 0 || B % b != 0) return INF;
  long long val1 = A / a;
  long long val2 = B / b;
  if (val1 % 2 != val2 % 2) return INF;
  if (!val1 && !val2) return 0;
  if (!canMoveX || !canMoveY) return INF;
  return max(val1, val2);
}
int main() {
  cin >> n >> m >> i >> j >> a >> b;
  if (i - a >= 1 || i + a <= n) canMoveX = true;
  if (j - b >= 1 || j + b <= m) canMoveY = true;
  long long c1 = go(1, m);
  long long c2 = go(n, 1);
  long long c3 = go(n, m);
  long long c4 = go(1, 1);
  long long ans = min(min(c1, c2), min(c3, c4));
  if (ans == INF)
    cout << "Poor Inna and pony!\n";
  else
    cout << ans << endl;
  return 0;
}
