Not an official ACM page
[Problem H | 1994 Western European Regional problem set | My ACM problem archive | my home page]

1994-1995 ACM International Collegiate Programming Contest
Western European Regional
Practice Session

Problem G

Typing

With the introduction of computers in today's life, typing skills are essential for all. As a result, one of the typing teachers has a booming business. Yesterday, however, she made the mistake of specifying the following test for her students: 'Type lines of 26 characters each, such that each letter in the alphabet occurs exactly once'.

Now that she sits at home and wants to mark the tests, she has discovered that instead of typing the alphabet in order, most took the liberty to type any permutation of the alphabet.

What she would like you to do, is write a program which marks the test for her, meaning that you have to check for each line of characters whether it is correct, i.e., it is a permutation of the 26 lowercase letters of the alphabet.

Input Specification

The first line of input contains an integer N specifying the number of test cases. Each test case is one line of text, no longer than 80 characters.

Output Specification

For each test case, you should create a single line of output. The line should read 'OK.' if the input line is exactly a permutation of the 26 lowercase letters of the alphabet, and 'Nope.', if it is not.

Example Input

4
abcdefghijklmnopqrstuvwxyz
zyxwvutsrqponm and so on
thequickbrownfxjmpsvlazydg
And now, for something completely different.

Example Output

OK.
Nope.
OK.
Nope.

This page maintained by Ed Karrels.
Last updated November 11, 1997