Line Them Up | 프로그래밍의 벗 PivotOJ
PivotOJ

Line Them Up

시간 제한: 1000ms메모리 제한: 256MB출처: ICPC Mid-Central Regional 2015BOJ 11536

문제

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.

입력

The input consists of a single test case. The first line will contain the number N of people on the team (2 ≤ N ≤ 20). Following that are N lines, each containing the name of one person. A name will be at least two characters and at most 12 characters in length and will consist only of capital letters, and with no white spaces (sorry BILLY BOB and MARY JOE). Duplicates names will not be allowed on a team.

출력

Output a single word: INCREASING if the list is in increasing alphabetical order, DECREASING if it is in decreasing alphabetical order, and otherwise NEITHER.

예제

예제 1

입력
5
JOE
BOB
ANDY
AL
ADAM
출력
DECREASING

예제 2

입력
11
HOPE
ALI
BECKY
JULIE
MEGHAN
LAUREN
MORGAN
CARLI
MEGAN
ALEX
TOBIN
출력
NEITHER

예제 3

입력
4
GEORGE
JOHN
PAUL
RINGO
출력
INCREASING
코드를 제출하려면 로그인하세요.