#include #include using namespace std; int main() { int a[10][4]={{0},{1},{6,2,4,8},{1,3,9,7},{6,4},{5},{6},{1,7,9,3},{6,8,4,2},{1,9}},m,n,j; while(cin>>j) { while(cin>>n) { m=n%10; if(m==0||m==1||m==5||m==6) co