inputs: Solve in Python:
Dima and Inna are doing so great! At the moment, Inna is sitting on the magic lawn playing with a pink pony. Dima wanted to play too. He brought an n × m chessboard, a very tasty candy and two numbers a and b.

Dima put the chessboard in front of Inna and placed the candy in position (i, j) on the board. The boy said he would give the candy if it reaches one of the corner cells of the board. He's got one more condition. There can only be actions of the following types:

  move the candy from position (x, y) on the board to position (x - a, y - b);  move the candy from position (x, y) on the board to position (x + a, y - b);  move the candy from position (x, y) on the board to position (x - a, y + b);  move the candy from position (x, y) on the board to position (x + a, y + b). 

Naturally, Dima doesn't allow to move the candy beyond the chessboard borders.

Inna and the pony started shifting the candy around the board. They wonder what is the minimum number of allowed actions that they need to perform to move the candy from the initial position (i, j) to one of the chessboard corners. Help them cope with the task! 


-----Input-----

The first line of the input contains six integers n, m, i, j, a, b (1 ≤ n, m ≤ 10^6; 1 ≤ i ≤ n; 1 ≤ j ≤ m; 1 ≤ a, b ≤ 10^6).

You can assume that the chessboard rows are numbered from 1 to n from top to bottom and the columns are numbered from 1 to m from left to right. Position (i, j) in the statement is a chessboard cell on the intersection of the i-th row and the j-th column. You can consider that the corners are: (1, m), (n, 1), (n, m), (1, 1).


-----Output-----

In a single line print a single integer — the minimum number of moves needed to get the candy.

If Inna and the pony cannot get the candy playing by Dima's rules, print on a single line "Poor Inna and pony!" without the quotes.


-----Examples-----
Input
5 7 1 3 2 2

Output
2

Input
5 5 2 3 1 1

Output
Poor Inna and pony!



-----Note-----

Note to sample 1:

Inna and the pony can move the candy to position (1 + 2,...
targets: #import math
#n, m = input().split()
#n = int (n)
#m = int (m)
#n, m, k= input().split()
#n = int (n)
#m = int (m)
#k = int (k)
#l = int(l)
#m = int(input())
#s = input()
##t = input()
#a = list(map(char, input().split()))
#a.append('.')
#print(l)
#a = list(map(int, input().split()))
#c = sorted(c)
#x1, y1, x2, y2 =map(int,input().split())
#n = int(input())
#f = []
#t = [0]*n
#f = [(int(s1[0]),s1[1]), (int(s2[0]),s2[1]), (int(s3[0]), s3[1])]
#f1 = sorted(t, key = lambda tup: tup[0])
x1, y1, x3, y3, x2, y2 = input().split()
x1 = int(x1)
x2 = int(x2)
x3 = int(x3)
y1 = int(y1)
y2 = int(y2)
y3 = int(y3)
mi =  x1*y1
if((x3-1) % x2 == 0 and (y3-1) % y2 == 0 and ((x3-1) / x2) %2 == ((y3-1)/ y2)%2):
    mi = min(mi, max((x3-1)/x2,(y3-1)/y2))  
if((x3-1) % x2 == 0 and (y1-y3) % y2 == 0 and ((x3-1) / x2) %2 == ((y1-y3)/ y2)%2):
    mi = min(mi, max((x3-1)/x2,(y1-y3)/y2))  
if((x1-x3) % x2 == 0 and (y3-1) % y2 == 0 and ((x1-x3) / x2) % 2 == ((y3-1)/ y2)%2):
    mi = min(mi, max((x1-x3)/x2,(y3-1)/y2)) 
if((x1-x3) % x2 == 0 and (y1-y3) % y2 == 0 and ((x1-x3) / x2)%2 == ((y1-y3)/ y2)%2):
    mi = min(mi, max((x1-x3)/x2,(y1-y3)/y2))   
if (mi == x1*y1 or ( (x2 >= x3 and x2 > x1-x3)  and mi != 0)or ((y2 >= y3 and y2 > y1-y3)  and mi != 0)):
    print("Poor Inna and pony!")
else:
    print(int(mi))