#include <iostream>
using namespace std;
// 时间O(n), 空间O(1)
int main(void)
{
int tmp1 = 0;
int tmp2 = 0;
int n = 0;
int ordered1 = 0;
int ordered2 = 0;
cin >> n;
int i = 0;
for (i = 0; i < n; i++)
{
if (i == 0)
cin >> tmp1;
cin >> tmp2;
if (tmp1 > tmp2)
ordered1 = 1;
else if (tmp1 < tmp2)
ordered2 = 1;
tmp1 = tmp2;
cout << "unsorted" << endl;
else
cout << "sorted" << endl;
return 0;
}
using namespace std;
// 时间O(n), 空间O(1)
int main(void)
{
int tmp1 = 0;
int tmp2 = 0;
int n = 0;
int ordered1 = 0;
int ordered2 = 0;
cin >> n;
int i = 0;
for (i = 0; i < n; i++)
{
if (i == 0)
cin >> tmp1;
cin >> tmp2;
if (tmp1 > tmp2)
ordered1 = 1;
else if (tmp1 < tmp2)
ordered2 = 1;
tmp1 = tmp2;
}
// ordered1 和 ordered2 都为1 则是乱序的
if (ordered1 + ordered2 > 1)cout << "unsorted" << endl;
else
cout << "sorted" << endl;
return 0;
}