#include<stdio.h>
int main()
{
    int n = 0;
    int arr[20] = { 0 };
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &arr[i]);
    }
    int m = 0;
    if (arr[0] >= arr[1])
    {
        for (int x = 0; x < n - 1; x++)
        {
            if (arr[x] >= arr[x + 1])
                m++;
            //continue;
            else
                
                break;
        }
    }
    if (arr[0] < arr[1])
    {
        for (int x = 0; x < n - 1; x++)
        {
            if (arr[x] < arr[x + 1])
                m++;
            //continue;
            else
                break;
        }
    }
    if (m == n - 1)
        printf("sorted");
    else
        printf("unsorted");
    return 0;
}