{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eMr. Fib is a mathematics teacher of a primary school. In the next lesson, he is planning to teach children how to add numbers up. Before the class, he will prepare $N$ cards with numbers. The number on the $i$-th card is $a_i$. In class, each turn he will remove no more than $3$ cards and let students choose any ten cards, the sum of the numbers on which is $87$. After each turn the removed cards will be put back to their position. Now, he wants to know if there is at least one solution of each turn. Can you help him?\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line of input contains an integer $t~(t \\le 5)$, the number of test cases. $t$ test cases follow.\u003cbr\u003eFor each test case, the first line consists an integer $N(N \\leq 50)$.\u003cbr\u003eThe second line contains $N$ non-negative integers $a_1, a_2, ... , a_N$. The $i$-th number represents the number on the $i$-th card. The third line consists an integer $Q(Q \\leq 100000)$. Each line of the next $Q$ lines contains three integers $i,j,k$, representing Mr.Fib will remove the $i$-th, $j$-th, and $k$-th cards in this turn. A question may degenerate while $i\u003dj$, $i\u003dk$ or $j\u003dk$."}},{"title":"Output","value":{"format":"HTML","content":"For each turn of each case, output \u0027Yes\u0027 if there exists at least one solution, otherwise output \u0027No\u0027."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n12\r\n1 2 3 4 5 6 7 8 9 42 21 22\r\n10\r\n1 2 3\r\n3 4 5\r\n2 3 2\r\n10 10 10\r\n10 11 11\r\n10 1 1\r\n1 2 10\r\n1 11 12\r\n1 10 10\r\n11 11 12\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNo\r\nNo\r\nNo\r\nYes\r\nNo\r\nYes\r\nNo\r\nNo\r\nYes\r\nYes\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}