1554 Correct Solution
Description
Everyone knows Daimin big cow is very strong,so he often give tough problems to others to solve. One day Daimin big cow came across Ganggang,he asked Ganggang to solve a problem.He told the number n to Ganggang and said:
----Shuffle the digits in this number in order to obtain the smallest possible number without leading zeros.
----No problem! ---said Ganggang and immediately gave him an answer.
Daimin big cow said a random nmber,so he doesn’t know whether Ganggang’s answer is correct.Help him to find this out,because impatient Ganggang is waiting for the verdict.
Input
The first line contains one integer n (0≤n≤109) without leading zeroes. The second lines contain one integer m (0≤m≤109) — Ganggang's answer, possibly with leading zeroes.
Output
Print “Ganggang is perfect” if Ganggang's answer is correct and “poor Ganggang” otherwise.
Sample
Input
2134
1234
2134
3124
Output
Ganggang is perfect
poor Ganggang
Source: t_c
Comments