In what concerns the continuous evaluation solving exercises grade during the semester, you should submit until 23:59 of March 24th
(this exercise will still be available for submission after that deadline, but without couting towards your grade)
[to understand the context of this problem, you should read the class #03 exercise sheet]


[PII022] Spin me right round

Numbers have personalities too! Some like to climb up in ascending order, while others prefer to slide down in a nice, orderly descent. But some numbers? Well, they just can't make up their mind and zigzag all over the place! Your task today is to determine if a number has its act together or if it's simply a chaotic mess.

The Problem

Write a program that, given several integers, checks for each one if its digits are arranged in a strictly ascending or descending order, or if the number is unordered.

Input

The first line of input contains an integer T, representing the number of test cases that follow.

Each of the following T lines contains one integer N, representing the number we want to check the digits.

Output

The output should have exactly T lines, one per input test case.

Each of these lines should contain one of the following statements:

Constraints

The following limits are guaranteed in all the test cases that will be given to your program:

1 ≤ T ≤ 10       Number of test cases
10 ≤ N ≤ 109       Number to check the digits

Example Input Example Output
4
1356
985
96753
122
1356: increasing
985: decreasing
96753: not ordered
122: not ordered

Programming II (CCINF1002)
DCC/FCUP - University of Porto