#27926: _CPP


11030067@mail.hpsh.tp.edu.tw (和平110級鄧雨珊)


#include <iostream>
using namespace std;

int main(){
int n, a[10];
cin >> n;
cout <<"Lumberjacks:\n";
while (n--){
for (int i=0; i<10; i++){
cin >> a[i];
}
bool acd=a[1]>a[0];
bool order=true;
for (int i=0; i<9; i++){
if (acd && a[i]>a[i+1]){
order=false;
break;
}
else if (!acd && a[i]<a[i+1]){
order=false;
break;
}
}
if (order){
cout <<"Ordered\n";
}
else {
cout <<"Unordered\n";
}
}
}