int main()
{
    int arr[50] = { 0 };
    int n = 0;
    scanf("%d", &n);
    int i = 0;
    int flag = 0;
    for (i = 0; i < n; i++)
    {
        scanf("%d", &arr[i]);
    }
    for (i = 0; i < n - 1; i++)
    {
        if (arr[i] >= arr[i + 1])
            flag++;
        else
            flag--;
    }
    if ((flag == n - 1) || (flag == 1 - n))
        printf("sorted\n");
    else
        printf("unsorted\n");
    return 0;
}