Tennis Club

Time limit1sMemory limit128 MB

Problem

The Matchball tennis club is holding a "game interest week" to recruit new members. To draw attention, its star players play exhibition matches, and each player decides in advance how many matches they will play. For variety, the organizers want to build a schedule in which no two players ever meet more than once.

Write a program that decides whether a schedule satisfying all of the following conditions can be built.

  • Each player plays exactly the number of matches they chose.
  • Any two players meet at most once.
  • No player can play against themselves.

Input

The first line contains the number of players N (2 ≤ N ≤ 1000).

Each of the next N lines contains one integer Gi, the number of matches player i has decided to play (1 ≤ Gi < N).

Players are numbered from 1 to N in the order given in the input.

Output

Print SCHEDULE on the first line if a schedule satisfying all of the conditions above exists, or NO SCHEDULE if it does not.