Musical Scale

Time limit1sMemory limit128 MB

Summary
Given a permutation of 1 through 8, print whether it is strictly ascending, strictly descending, or otherwise mixed.
Level

Easy1 of 10

Topics
Array, Implementation
Solved
No attempts yet

Problem

The C major scale consists of the 8 notes c d e f g a b C. In this problem, those notes are represented by numbers: c is 1, d is 2, ..., and C is 8.

If the 8 played notes appear in the order 1 2 3 4 5 6 7 8, the sequence is ascending. If they appear in the order 8 7 6 5 4 3 2 1, the sequence is descending. In every other case, the sequence is mixed.

Write a program that determines which of the three cases the given performance order belongs to.

Input

The first line contains 8 integers separated by spaces. Each integer represents one note described above, and every integer from 1 through 8 appears exactly once.

Output

Print ascending if the performance order is increasing, descending if it is decreasing, and mixed otherwise.

Examples3

  1. Example 1

    Input
    1 2 3 4 5 6 7 8
    
    Expected output
    ascending
    
  2. Example 2

    Input
    8 7 6 5 4 3 2 1
    
    Expected output
    descending
    
  3. Example 3

    Input
    8 1 7 2 6 3 5 4
    
    Expected output
    mixed