#K73942. Determine Winner in the Game
Determine Winner in the Game
Determine Winner in the Game
You are given an array of integers which represents the configuration of a game. In this game, the outcome is decided as follows: if the array is sorted in non-decreasing order, then Alice wins; if not, then John wins.
This can be formally expressed as: if the array \(a_1, a_2, \dots, a_n\) satisfies \(a_1 \le a_2 \le \dots \le a_n\), then the winner is Alice; otherwise, the winner is John.
Your task is to determine the winner based on the input configuration provided through standard input.
inputFormat
The first line contains an integer (n), which is the number of elements in the array. The second line contains (n) space-separated integers representing the elements of the array.
outputFormat
Print a single string: either "John" if John has a winning strategy, or "Alice" if the array is sorted and thus Alice wins.## sample
5
1 2 3 4 5
Alice