{"raw_statement":[{"iden":"statement","content":"Optical Character Recognition (OCR) is one of the most famous fields of Artificial Intelligence. The main purpose of OCR is to recognize printed text (or handwriting) and convert it to the machine encoded-text. You may have seen similar applications in your smartphone: you use your camera to take a photo that contains text, then, the text is translated or saved in PDF, for example.  In this problem we deal with a very limited case of OCR. You have a scanned character which is either ‘0’ (number zero) or ‘8’ (number eight) and you have to decide what number it is.  The input will be an image that contains exactly one character (It is guaranteed that this character is either ‘0’ or ‘8’). The image has 2 colors: white (represented with dot ‘.’) and black (represented with asterisk ‘*’).  For simplicity, the borders of the image are always white. It’s also guaranteed that black lines inside the image are either vertical or horizontal. So you may safely assume that the shapes of ‘0’ and ‘8’ inside the image are the same as their shapes in digital clocks. However, they might be stretched or not positioned in the center of the image.\n\nThe first line will be the number of test cases T (T<100).  Each test case starts with two positive integers (n,m) denoting the dimensions of the image. (n,m < 20).  Each of the following n lines contains m values which represent the image.\n\nFor each test case, print one line which contains the number of the test case, and the recognition result: ‘Zero’ or ‘Eight’. See the samples and follow the output format.\n\n"},{"iden":"input","content":"The first line will be the number of test cases T (T<100).  Each test case starts with two positive integers (n,m) denoting the dimensions of the image. (n,m < 20).  Each of the following n lines contains m values which represent the image."},{"iden":"output","content":"For each test case, print one line which contains the number of the test case, and the recognition result: ‘Zero’ or ‘Eight’. See the samples and follow the output format."},{"iden":"examples","content":"Input38 10............*****.....*...*.....*...*.....*****.....*...*.....*****.............6 10............*****.....*...*.....*...*.....*****.............10 7..............................****...*..*...****...*..*...****........OutputCase 1: EightCase 2: ZeroCase 3: Eight"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ k \\in \\{1, \\dots, T\\} $:  \n- Let $ n_k, m_k \\in \\mathbb{Z}^+ $ denote the dimensions of the image.  \n- Let $ I_k \\in \\{., *\\}^{n_k \\times m_k} $ be the binary image, where `.` = white and `*` = black.  \n\n**Constraints**  \n1. $ 1 \\le T < 100 $  \n2. For each $ k $:  \n   - $ 1 \\le n_k, m_k < 20 $  \n   - The image contains exactly one character: either ‘0’ or ‘8’  \n   - Border pixels are all `.`  \n   - All black pixels form only horizontal or vertical line segments  \n   - The shapes of ‘0’ and ‘8’ are digit-clock-like (i.e., 7-segment style)  \n\n**Objective**  \nFor each test case $ k $, determine whether $ I_k $ represents ‘0’ or ‘8’:  \n- ‘0’ has exactly one enclosed region (a single loop)  \n- ‘8’ has exactly two enclosed regions (two loops)  \n\nOutput:  \n- “Zero” if $ I_k $ represents ‘0’  \n- “Eight” if $ I_k $ represents ‘8’","simple_statement":"You are given an image of either a '0' or an '8' made of dots (.) and stars (*). The image is small (less than 20x20). Decide if it's a '0' or an '8' and print \"Zero\" or \"Eight\".","has_page_source":false}