Welcome to ZOJ
Information
Select Problem
Runs
Ranklist
ZOJ Problem Set - 3311
ZOJ Special AC String

Time Limit: 1 Second      Memory Limit: 32768 KB

Since today is so special, ZOJ would only accept a special kind of strings to pass its tests. The AC rules are given as the following:

  • 1. there are only three distinct capital letters of the strings: Z, O, and J;
  • 2. any string that is in the form xZOJxO is acceptable, where x is a string either empty or composed of O's only;
  • 3. if aZbJc is acceptable, then aZbOJcO is acceptable, where a, b and c are all strings either empty or composed of O's only.

Now it is your job to write a special judge program to tell if an input string is an AC string.

Input

The input consists of multiple test cases, each occupies a line containing the input string with length greater than 1 and less than 100. The string consists of only 'Z', 'O', and 'J'. Proceed until the end of file.

Output

For each test case, print in a line "Accepted" if the string is acceptable, or "Wrong Answer" if not.

Sample Input

ZOJO
OZOJOO
OZOOJOOO
OZOZOJOO
OOZOOJO

Sample Output

Accepted
Accepted
Accepted
Wrong Answer
Wrong Answer

Author: CHEN, Yue
Source: ZOJ 8th Anniversary Contest
Submit    Status