import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan= new Scanner(System.in);
int n=scan.nextInt();
int res[]=new int[n];
for(int i=0;i
res[i]=scan.nextInt();
}
boolean temp1=sorted1(res);
boolean temp2=sorted2(res);
boolean temp3=sorted3(res);
if(temp1||temp2||temp3){
System.out.println("sorted");
}else{
System.out.println("unsorted");
}
}
public static boolean sorted1(int res[]){
for(int i=0;i
if(res[i]>=res[i+1]){
return false;
}
}
return true;
}
public static boolean sorted2(int res[]){
for(int i=0;i
if(res[i]<=res[i+1]){
return false;
}
}
return true;
}
public static boolean sorted3(int res[]){
for(int i=0;i
if(res[i]!=res[i+1]){
return false;
}
}
return true;
}
}