#include <bits/stdc++.h>
using namespace std;
long long n, m, I, J, a, b;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> I >> J >> a >> b;
  long long gy[] = {1, n, n, 1};
  long long gx[] = {m, 1, m, 1};
  long long ans = 1070000000LL;
  for (int i = 0; i < (4); i++) {
    long long dy = abs(gy[i] - I);
    long long dx = abs(gx[i] - J);
    if (dy == 0 && dx == 0) {
      return cout << 0, 0;
    }
    if (a >= n || b >= m) continue;
    if (dy % a) continue;
    if (dx % b) continue;
    dy /= a;
    dx /= b;
    if (abs(dy - dx) % 2) continue;
    ans = min(ans, max(dy, dx));
  }
  if (ans == 1070000000LL)
    cout << "Poor Inna and pony!" << endl;
  else
    cout << ans;
}
