import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int W = in.nextInt(); int N = in.nextInt(); int[] js = new int[N]; for( int i = 0; i < N; i++ ) js[i] = in.nextInt(); int M = in.nextInt(); int[] cs = new int[M]; for( int i = 0; i < M; i++ ) cs[i] = in.nextInt(); MaxFlow f = new MaxFlow(2 + M + N); for( int i = 0; i < N; i++ ) f.addEdge(0, 1 + i, js[i]); for( int i = 0; i < M; i++ ) { f.addEdge(1 + N + i, M + N + 1, cs[i]); int q = in.nextInt(); boolean[] bad = new boolean[N]; for( int j = 0; j < q; j++ ) { bad[in.nextInt()-1] = true; } for( int j = 0; j < N; j++ ) { if( !bad[j] ) f.addEdge( 1 + j, 1 + N + i, W ); } } int flow = f.run( 0, M+N+1); // System.out.println("flow: " + flow); if( flow >= W ) { System.out.println("SHIROBAKO"); }else { System.out.println("BANSAKUTSUKITA"); } } } class Edge { int from; int to; int cap; Edge rev; public Edge( int from, int to, int cap ) { this.from = from; this.to = to; this.cap = cap; } } class MaxFlow { int N; ArrayList> g; ArrayList edges; public MaxFlow(int N) { this.N = N; this.g = new ArrayList>(); this.edges = new ArrayList(); for( int i = 0; i < N; i++ ) { this.g.add(new ArrayList()); } } public void addEdge( int from, int to, int cap ) { Edge e1 = new Edge( from, to, cap ); Edge e2 = new Edge( to, from, 0 ); e1.rev = e2; e2.rev = e1; g.get(from).add(e1); g.get(to).add(e2); } public int run( int src, int sink ) { int flow = 0; while( true ) { boolean[] vis = new boolean[N]; LinkedList path = new LinkedList(); boolean b = dfs(vis, path, src, sink ); if( !b ) break; int cap = Integer.MAX_VALUE; for( Edge e : path ) cap = Math.min(e.cap,cap); flow += cap; /* System.out.println("cap : " + cap); System.out.print("path :" + src); */ for( Edge e : path ) { //System.out.print(" " + e.to); e.cap -= cap; e.rev.cap += cap; } //System.out.println(); } return flow; } private boolean dfs(boolean[] vis, LinkedList path, int v, int t ) { if( v == t ) return true; if( vis[v] ) return false; vis[v] = true; for( Edge e : g.get(v) ) { if( !vis[e.to] && e.cap > 0) { path.add(e); if( dfs(vis, path, e.to, t) ) { return true; } path.removeLast(); } } return false; } }