int main()
{
int n = 0;
scanf("%d",&n);
int arr[50]={0};
int i = 0;
for(i = 0;i<n;i++)
{
scanf("%d ",&arr[i]);
}
int up = 0;
int down = 0;
for(i = 0;i<n-1;i++)
{
if(arr[i+1]>=arr[i])//升序
{
up++;//1 6 6 9 9 22 22 30
}
if(arr[i+1]<=arr[i])//降序
{
down++;
}
}
if(up==(n-1)||down==(n-1))
{
printf("sorted");
}
else
{
printf("unsorted");
}
return 0;
}