import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int[] arr = new int[n];
int index = 0;
while(scan.hasNextInt()) {
arr[index++] = scan.nextInt();
}
int[] copyArr = new int[n];
System.arraycopy(arr, 0, copyArr, 0, n);
Arrays.sort(copyArr);
int[] copyArrDaoxu = new int[n];
for(int i = 0; i < n; i++) {
copyArrDaoxu[i] = copyArr[n - i - 1];
}
if(Arrays.equals(arr, copyArr) || Arrays.equals(arr, copyArrDaoxu)) {
System.out.println("sorted");
} else {
System.out.println("unsorted");
}
}
}