#include <iostream>
using namespace std;
int main()
{
int n;
int arr[50] = { 0 };
int count1=0, count2=0;
while (cin >> n)
{
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
for (int i = 0; i < n - 1; i++)
{
if (arr[i] >= arr[i + 1])
{
count1++;
}
}
for (int i = 0; i < n - 1; i++)
{
if (arr[i] <= arr[i + 1])
{
count2++;
}
}
if (count1 == n - 1 || count2 == n - 1)
{
cout << "sorted"<<endl;
}
else
{
cout << "unsorted"<<endl;
}
}
}
using namespace std;
int main()
{
int n;
int arr[50] = { 0 };
int count1=0, count2=0;
while (cin >> n)
{
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
for (int i = 0; i < n - 1; i++)
{
if (arr[i] >= arr[i + 1])
{
count1++;
}
}
for (int i = 0; i < n - 1; i++)
{
if (arr[i] <= arr[i + 1])
{
count2++;
}
}
if (count1 == n - 1 || count2 == n - 1)
{
cout << "sorted"<<endl;
}
else
{
cout << "unsorted"<<endl;
}
}
}