import java.util.Scanner;
public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        int countZheng = 0;    // 记录后面的数比前面的数大的次数
        int countFan = 0;      // 记录前面的数比后面的数大的次数
        array[0] = sc.nextInt();
        for(int i = 1 ; i < n ; i++) {
            array[i] = sc.nextInt();
            if(array[i] >= array[i-1]) {
                countZheng++;
            }
            if(array[i] <= array[i-1]) {
                countFan++;
            }
        }
        if(countZheng == n - 1 || countFan == n-1) {
            System.out.println("sorted");
        } else {
            System.out.println("unsorted");
        }
    }
}