#define forn(i, n) for (int i = 0; i < (int)(n); i++)
struct Stack
{
int n, *a, size;
Stack()
{
n = 0, size = 1, a = new int[size];
}
void Push( int x )
{
if (n >= size)
{
int *b = new int[size *= 2];
forn(i, n)
b[i] = a[i];
delete [] a;
a = b;
}
a[n++] = x;
}
int Pop()
{
return a[--n];
}
void clear()
{
n = 0;
}
};
/*
vector <int> v;
forn(i, N)
v.push_back();
v.clear();
v.resize(0);
v[i]
v.at(i)
struct myVector : vector
{
int & operator [] ( int i )
{
assert(0 <= i && i < (int)a.size());
return a[i];
}
}
myVector <int> a;
a[i]
*/