Problem B
Line Them Up
An eccentric coach asks players on the team to line up alphabetically at the start of practice. The coach does not tell the players whether they need to line up in increasing or decreasing order, so they guess. If they guess wrong, the coach makes them run laps before practice. Given a list of names, you are to determine if the list is in increasing alphabetical order, decreasing alphabetical order or neither.
Input
The input consists of a single test case. The first line
will contain the number
Output
Output a single word: INCREASING if the list is in increasing alphabetical order, DECREASING if it is in decreasing alphabetical order, and otherwise NEITHER.
Sample Input 1 | Sample Output 1 |
---|---|
5 JOE BOB ANDY AL ADAM |
DECREASING |
Sample Input 2 | Sample Output 2 |
---|---|
11 HOPE ALI BECKY JULIE MEGHAN LAUREN MORGAN CARLI MEGAN ALEX TOBIN |
NEITHER |
Sample Input 3 | Sample Output 3 |
---|---|
4 GEORGE JOHN PAUL RINGO |
INCREASING |