/*
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
using namespace std;
template<typename T>
class stack
{
private:
unsigned int size = 0;
T main_arr[10000];
public:
bool empty(void)
{
return !size;
}
T top(void)
{
return main_arr[size-1];
}
void pop(void)
{
size--;
}
void push(T input)
{
main_arr[size] = input;
size++;
}
void clear(void)
{
size = 0;
}
};
bool open(char a)
{
if(a=='<'||a=='('||a=='{'||a=='[')
{
return 1;
}
return 0;
}
bool close(char a)
{
if(a=='>'||a==')'||a=='}'||a==']')
{
return 1;
}
return 0;
}
bool match(char a,char b)
{
if(a=='<'&&b=='>')
{
return 1;
}
if(a=='('&&b==')')
{
return 1;
}
if(a=='{'&&b=='}')
{
return 1;
}
if(a=='['&&b==']')
{
return 1;
}
return 0;
}
int main()
{
stack<char> st;
char temp[10000];
int n,i;
int test;
bool answer;
for(test = 1;test <= 10;test++)
{
answer = 1;
scanf("%d ",&n);
scanf("%s",temp);
for(i = 0;i < n;i++)
{
//printf("%c",temp);
if(close(temp[i])&&answer)
{
if(st.empty())
{
answer = false;
}
else if(match(st.top(),temp[i]))
{
st.pop();
}
else
{
answer = false;
}
}
if(open(temp[i]))
{
st.push(temp[i]);
}
}
answer = st.empty()&answer;
printf("#%d %d\n",test,answer);
st.clear();
}
}
*/
/*
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int t= 1;
struct a
{
int lo;
int num;
};
int main()
{
int arr[2000] = {0,};
int i,j;
int n;
a small,big;
scanf("%d",&n);
for(i = 0; i < 100; i++)
{
scanf("%d ",&arr[i]);
}
for( i =0; i < n; i++)
{
big.num = -1;
small.num = 24545646;
for(j = 0; j < 100; j++)
{
if(small.num > arr[j])
{
small.lo = j;
small.num = arr[j];
}
if(big.num < arr[j])
{
big.lo = j;
big.num = arr[j];
}
}
arr[big.lo]--;
arr[small.lo]++;
}
big.num = -1;
small.num = 24545646;
for(j = 0; j < 100; j++)
{
if(small.num > arr[j])
{
small.lo = j;
small.num = arr[j];
}
if(big.num < arr[j])
{
big.lo = j;
big.num = arr[j];
}
}
printf("#%d %d\n",t,big.num-small.num);
t++;
if(t!=11)
main();
}
**/
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
int n;
}