#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <iterator>
#include <functional>
#include <complex>
#include <queue>
#include <stack>
#include <cmath>
#include <cassert>
#include <cstring>
using namespace std;
typedef long long LL;
typedef complex<double> CMP;
class PointErasing { public:
vector<int> ans;
vector <int> getOutcomes(vector <int> y)
{
rec(1, y, y[0], y[1], 1);
return ans;
}
void rec(int i, const vector<int>& y, int lo, int hi, int c)
{
if( i == y.size() ) {
if(c>1)
ans.push_back(c);
return;
}
rec(i+1, y, lo, hi, c);
if( lo < y[i] && y[i] < hi ) {
ans.push_back(c+1);
return;
}
}
};
// BEGIN CUT HERE
#include <ctime>
double start_time; string timer()
{ ostringstream os; os << " (" << int((clock()-start_time)/CLOCKS_PER_SEC*1000) << " msec)"; return os.str(); }
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v)
{ os << "{ ";
for(typename vector<T>::const_iterator it=v.begin(); it!=v.end(); ++it)
os << '\"' << *it << '\"' << (it+1==v.end() ? "" : ", "); os << " }"; return os; }
void verify_case(const vector <int>& Expected, const vector <int>& Received) {
bool ok = (Expected == Received);
if(ok) cerr << "PASSED" << timer() << endl; else { cerr << "FAILED" << timer() << endl;
cerr << "\to: " << Expected << endl << "\tx: " << Received << endl; } }
#define CASE(N) {cerr << "Test Case #" << N << "..." << flush; start_time=clock();
#define END verify_case(_, PointErasing().getOutcomes(y));}
int main(){
CASE(0)
int y_[] = { 1, 2, 1, 1, 0, 4, 3 };
vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_));
int __[] = {4, 6 };
vector <int> _(__, __+sizeof(__)/sizeof(*__));
END
CASE(1)
int y_[] = { 0, 0, 4, 4, 8, 8, 4, 4 };
vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_));
int __[] = {6 };
vector <int> _(__, __+sizeof(__)/sizeof(*__));
END
CASE(2)
int y_[] = { 522 };
vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_));
int __[] = {1 };
vector <int> _(__, __+sizeof(__)/sizeof(*__));
END
CASE(3)
int y_[] = { 19, 19, 19, 19, 19, 19 };
vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_));
int __[] = {6 };
vector <int> _(__, __+sizeof(__)/sizeof(*__));
END
CASE(4)
int y_[] = { 0, 1, 2, 3, 4 };
vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_));
int __[] = {2 };
vector <int> _(__, __+sizeof(__)/sizeof(*__));
END
CASE(5)
int y_[] = { 7, 8, 8, 7, 6, 7, 9, 3, 5, 0 };
vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_));
int __[] = {3, 4, 5 };
vector <int> _(__, __+sizeof(__)/sizeof(*__));
END
CASE(6)
int y_[] = { 3, 2, 3, 3, 4, 3, 4, 3, 3, 1, 5, 3 };
vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_));
int __[] = {4, 5, 6, 7, 9 };
vector <int> _(__, __+sizeof(__)/sizeof(*__));
END
CASE(7)
int y_[] = { 5, 5, 4, 4, 5, 8, 5, 5, 5, 5, 5, 9, 2, 0, 9, 4, 5, 5, 3, 4, 4, 4, 4, 7, 4 };
vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_));
int __[] = {6, 7, 8, 10, 11, 12, 13, 15, 16, 17 };
vector <int> _(__, __+sizeof(__)/sizeof(*__));
END
CASE(8)
int y_[] = ;
vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_));
int __[] = ;
vector <int> _(__, __+sizeof(__)/sizeof(*__));
END
CASE(9)
int y_[] = ;
vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_));
int __[] = ;
vector <int> _(__, __+sizeof(__)/sizeof(*__));
END
}
// END CUT HERE