import java.io.*; public class bj_yuizumi { private static int score(String line) { boolean isSoft = false; int pts = 0; for(int i = 0; i < 10; i++) { char card = line.charAt(i * 2); switch(card) { case 'A': pts += isSoft ? 1 : 11; isSoft = true; break; case 'T': case 'J': case 'Q': case 'K': pts += 10; break; default: pts += card - '0'; break; } if(isSoft && pts > 21) { isSoft = false; pts -= 10; } if(pts > 17 || (pts == 17 && !isSoft)) { if(pts > 21) return 0; if(pts == 21 && i < 2) return 22; return pts; } } throw new IllegalStateException(); } public static void main(String[] args) throws Exception { BufferedReader br = null; try { br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); for(int i = 0; i < n; i++) { String line1 = br.readLine(); String line2 = br.readLine(); int pts = score(line1 + " " + line2); switch(pts) { case 22: System.out.println("blackjack"); break; case 0: System.out.println("bust"); break; default: System.out.println(pts); break; } } } finally { if(br != null) br.close(); } } }