#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>n; vector x(n); for(Int i=0;i>x[i]; Int m; cin>>m; vector y(m); for(Int i=0;i>y[i]; vector b(30,0),w(30,0); for(Int i=0;i