COCI '09 Contest 1 #1 Note

View as PDF

Submit solution


Points: 3
Time limit: 1.0s
Memory limit: 32M

Problem type

C major scale consists of 8 tones: c d e f g a b C. For this task we number the notes using numbers 1 through 8. The scale can be played ascending, from 1 to 8, descending, from 8 to 1, or mixed. Write a program that, given the sequence of notes, determines whether the scale was played ascending, descending or mixed.

Input Specification

First and only line of input will contain 8 integers, from 1 to 8 inclusive. Each integer will appear exactly once in the input.

Output Specification

In the first and only line of output, print descending if the scale was played descending, ascending if the scale was played ascending or mixed if the scale was played mixed.

Sample Input 1

1 2 3 4 5 6 7 8

Sample Output 1

ascending

Sample Input 2

8 7 6 5 4 3 2 1

Sample Output 2

descending

Sample Input 3

8 1 7 2 6 3 5 4

Sample Output 3

mixed

Comments

There are no comments at the moment.