int main() {
    int n, max = 0, min = 0, equal = 0;
    scanf("%d", &n);
    int m[n];
    for (int i = 0; i < n; i++)
        scanf("%d ", &m[i]);
    for (int j = 1; j < n; j++) {  //判断三种有序序列的状态
        if (m[j] - m[j - 1] < 0) max++;
        if (m[j] - m[j - 1] > 0) min++;
        if (m[j] - m[j - 1] == 0) equal++;
    }
    //判断三种有序序列的状态是否正确
    if (min == n - 1 || max == n - 1 || equal == n - 1)
        printf("sorted");
    else
        printf("unsorted");
    return 0;
}