#include using namespace std; int n, a[2000],ifirst,dprev; int main() { while(cin >> n) { for(int i=0; i>a[i]; if(n==1) {cout<<1<