All over the world, peoples are working on energy solution. It would be a tough time for our next generation to survive if we don’t think about solution. Arya Stark is working on a new project and wants to display his project using “seven segment display - concept”. Arya Stark gave Bot a task to find a number from his Favorite list of number for which the energy consumption is lowest.
(Assuming that for a digit to represent Arya stark is using 7 LEDs and only those LEDs light up which are required to represent a number and rest other would be completely off.)
Help environment and conserve energy.
Seven segment display - https://en.wikipedia.org/wiki/Seven-segment_display
Note : Solution will be available after end of test. Like our page Codeboom for solutions.
Input:
First line will contain the number of test cases and for every test case first line will contain length of favorite list and the second line for a test case will contain n numbers.
Output:
For every test case print the answer. If there exist more than 1 numbers for which same number of bulbs are required than output the number which occurs first in the Favorite list.