#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; class Edge { public: int to, cap, rev; Edge(){}; Edge(int to0, int cap0){to = to0; cap = cap0;} Edge(int to0, int cap0, int rev0){to = to0; cap = cap0; rev = rev0;} }; int maxFlow(const vector >& edges0, int source, int sink) { static vector > edges; static vector index; static vector level; static int n; class Func{ public: static void bfs(int s){ level.assign(n, -1); queue q; level[s] = 0; q.push(s); while(!q.empty()){ int v = q.front(); q.pop(); for(unsigned i=0; i 0 && level[e.to] < 0){ level[e.to] = level[v] + 1; q.push(e.to); } } } } static int dfs(int s, int t, int f){ if(s == t) return f; for(unsigned& i=index[s]; i 0 && level[s] < level[e.to]){ int g = dfs(e.to, t, min(f, e.cap)); if(g > 0){ e.cap -= g; edges[e.to][e.rev].cap += g; return g; } } } return 0; } }; n = edges0.size(); edges.assign(n, vector()); for(int i=0; i 0) ret += f; } return 0; } int main() { int w, n; cin >> w >> n; vector a(n); for(int i=0; i> a[i]; int m; cin >> m; vector b(m); for(int i=0; i> b[i]; vector > ok(n, vector(m, true)); for(int i=0; i> q; for(int j=0; j> x; ok[x-1][i] = false; } } vector > edges(n+m+2); int source = n + m; int sink = n + m + 1; for(int i=0; i= w) cout << "SHIROBAKO" << endl; else cout << "BANSAKUTSUKITA" << endl; return 0; }