description: During the hypnosis session, Nicholas suddenly remembered a positive integer n, which doesn't contain zeros in decimal notation. 
  
  Soon, when he returned home, he got curious: what is the maximum number of digits that can be removed from the number so that the number becomes not prime, that is, either composite or equal to one?
  
  For some numbers doing so is impossible: for example, for number 53 it's impossible to delete some of its digits to obtain a not prime integer. However, for all n in the test cases of this problem, it's guaranteed that it's possible to delete some of their digits to obtain a not prime number.
  
  Note that you cannot remove all the digits from the number.
  
  A prime number is a number that has no divisors except one and itself. A composite is a number that has more than two divisors. 1 is neither a prime nor a composite number.
  
  Input
  
  Each test contains multiple test cases.
  
  The first line contains one positive integer t (1 ≤ t ≤ 10^3), denoting the number of test cases. Description of the test cases follows.
  
  The first line of each test case contains one positive integer k (1 ≤ k ≤ 50) — the number of digits in the number.
  
  The second line of each test case contains a positive integer n, which doesn't contain zeros in decimal notation (10^{k-1} ≤ n < 10^{k}). It is guaranteed that it is always possible to remove less than k digits to make the number not prime.
  
  It is guaranteed that the sum of k over all test cases does not exceed 10^4.
  
  Output
  
  For every test case, print two numbers in two lines. In the first line print the number of digits, that you have left in the number. In the second line print the digits left after all delitions. 
  
  If there are multiple solutions, print any.
  
  Example
  
  Input
  
  
  7
  3
  237
  5
  44444
  3
  221
  2
  35
  3
  773
  1
  4
  30
  626221626221626221626221626221
  
  
  Output
  
  
  2
  27
  1
  4
  1
  1
  2
  35
  2
  77
  1
  4
  1
  6
  
  Note
  
  In the first test case, you can't delete 2 digits from the number 237, as all the numbers 2, 3, and 7 are prime. However, you can delete 1 digit, obtaining a number 27 = 3^3.
  
  In the second test case, you can delete all digits except one, as 4 = 2^2 is a composite number.
solution: import java.io.*;
  import java.lang.reflect.Array;
  import java.math.RoundingMode;
  import java.text.DecimalFormat;
  import java.util.*;
  
  
  
  public class copy{
      public static int find(int a,int[] parent)
      {
          if(parent[a]==a)
              return a;
          return find(parent[a],parent);
      }
  
      public static void union(int a,int b,int[] parent, int[] rank)
      {
          int x=find(a,parent);
          int y=find(b,parent);
          if(rank[x]>rank[y])
          {
              parent[y]=x;
  
          }
          else if(rank[y]>rank[x])
          {
              parent[x]=y;
  
          }
          else
          {
              parent[y]=x;
              rank[x]++;
  
          }
      }
  
      static double answer;
  
      public static int check(ArrayList<ArrayList<Integer>> edges,int x,int parent,int[] statues,int n)
      {
          ArrayList<Integer> arr=new ArrayList<>();
          for(int i:edges.get(x))
          {
              if(i!=parent)
              {
                  arr.add(check(edges,i,x,statues,n));
              }
          }
          int sum=0;
          for(int i=arr.size()-1;i>=0;i--)
          {
  
              answer+=((long)arr.get(i)*(long)sum*(long)statues[x])/((double)n*(double)(n-1));
              sum+=arr.get(i);
          }
          answer+=((long)sum*(long)statues[x])/((double)n*(double)(n-1));
          //System.out.println(x+" "+sum);
          return 1+sum;
      }
  
      public static boolean check(int X,int a,int b)
      {
          System.out.println(X);
  
          if(X==1)
              return true;
          boolean status=false;
          if(X%a==0 && a!=1)
              status=status || check(X/a,a,b);
          if(X-b>=1 && b!=0)
              status=status || check(X-b,a,b);
  
          return status;
  
  
      }
  
      public static int check(long xor,ArrayList<Long> sum,int low,int N)
      {
          int l=low;
          int r=N-1;
          while(l<=r)
          {
              int mid=(l+r)/2;
              if(sum.get(mid)==xor)
              {
                  return mid;
              }
              else
                  r=mid-1;
          }
  
          return 0;
      }
  
      public static void merge(int l,int mid,int r,cp[] arr,HashMap<Integer,Integer> before)
      {
          int N=mid-l+1,M=r-mid;
          cp[] arr1=new cp[mid-l+1];
          cp[] arr2=new cp[r-mid];
          cp[] arr3=new cp[N+M];
          for(int i=l;i<=mid;i++)
              arr1[i-l]=arr[i];
          for(int i=mid+1;i<=r;i++)
              arr2[i-mid-1]=arr[i];
          int left=0,right=0,k=0;
          while(left<N && right<M)
          {
  
              if(arr1[left].a<arr2[right].a)
              {
                  arr3[k++]=arr1[left++];
              }
              else
              {
  
                  before.put(arr2[right].b,before.getOrDefault(arr2[right].b,0)+N-left);
                  count+=N-left;
                  arr3[k++]=arr2[right++];
              }
          }
  
          while(left<N)
          {
              arr3[k++]=arr1[left++];
          }
  
          while(right<M)
          {
              arr3[k++]=arr2[right++];
          }
  
          for(int i=l;i<=r;i++)
              arr[i]=arr3[i-l];
  
  
  
      }
  
      public static void inv(HashMap<Integer,Integer> before,int l,int r,cp[] arr)
      {
          if(l==r)
              return;
          int mid=(l+r)/2;
          inv(before,l,mid,arr);
          inv(before,mid+1,r,arr);
          merge(l,mid,r,arr,before);
      }
      static long count=0;
      public static int check(ArrayList<Long> arr,long X,int low,int N,long mod)
      {
          int l=low;
          int r=N;
          while(l<=r)
          {
              int mid=l+(r-l)/2;
              if(((arr.get(mid)-arr.get(low-1)))/(long)(mid-low+1)<X)
              {
                  if(mid+1<=N &&  ((arr.get(mid+1)-arr.get(low-1)))/(long)(mid-low+2)<X)
                      l=mid+1;
                  else
                      return mid;
              }
              else
                  r=mid-1;
          }
  
          return -1;
      }
  
      public static void check(ArrayList<ArrayList<Integer>> arr,int x,int parent,ArrayList<Integer> answer)
      {
          answer.add(x);
          for(int i:arr.get(x))
          {
              if(i!=parent)
              {
                  check(arr,i,x,answer);
                  answer.add(x);
              }
          }
  
      }
  
      static long binpow( long a,  long b,  long m) {
          a %= m;
          long  res = 1;
          while (b > 0) {
              if ((b & 1)==1)
                  res = res * a % m;
              a = a * a % m;
              b >>= 1;
          }
          return res;
      }
      public static int check(int N,int a,int b,int c,int[] dp)
      {
          if(dp[N]!=-2)
              return dp[N];
          if(N==0)
              return 0;
  
          int a1=-1,a2=-1,a3=-1;
          if(N>=a)
              a1=check(N-a,a,b,c,dp);
          if(N>=b)
              a2=check(N-b,a,b,c,dp);
          if(N>=c)
              a3=check(N-c,a,b,c,dp);
          if(a1==-1 && a2==-1 && a3==-1)
              dp[N]=-1;
          else
              dp[N]= 1+Math.max(a1,Math.max(a2,a3));
          return dp[N];
      }
  
  
  
      public static long gcd(long a,long b)
      {
          if(a==0)
              return b;
  
          return gcd(b%a,a);
      }
  
  
      public static int check(ArrayList<Double> arr,double number,int N)
      {
          int l=0;
          int r=N;
          while(l<=r)
          {
              int mid=(l+r)/2;
              if(number>=arr.get(mid))
              {
                  if(mid+1<=N && arr.get(mid+1)<=number)
                      l=mid+1;
                  else
                      return mid;
              }
              else
                  r=mid-1;
              //System.out.println("hello");
          }
  
          return 0;
      }
  
  
  //    public static int check(ArrayList<String> arr)
  //    {
  //        int ans=Integer.MAX_VALUE;
  //        ArrayList<Character> copy=new ArrayList<>();
  //        for(char ch='a';ch<='z';ch++)
  //        {
  //            int s1=0;
  //            for(String s:arr)
  //                if(s.indexOf(ch)!=-1)
  //                    ++s1;
  //            if(s1>1)
  //            {
  //                copy.add(ch);
  //            }
  //
  //        }
  //        if(copy.size()==0) {
  //            for (char ch = 'a'; ch <= 'z'; ch++) {
  //                int s1 = 0, s2 = 0;
  //                for (String s : arr)
  //                    if (s.indexOf(ch) != -1)
  //                        s1 += s.length();
  //                    else
  //                        s2 += s.length();
  //
  //                //System.out.println(ch+" "+s1+" "+s2);
  //                ans = Math.min(ans, Math.abs(s1 - s2));
  //
  //            }
  //        }
  //        else
  //        {
  //            for (char ch:copy) {
  //                int s1 = 0, s2 = 0;
  //                for (String s : arr)
  //                    if (s.indexOf(ch) != -1)
  //                        s1 += s.length();
  //                    else
  //                        s2 += s.length();
  //
  //                //System.out.println(ch+" "+s1+" "+s2);
  //                ans = Math.min(ans, Math.abs(s1 - s2));
  //
  //            }
  //        }
  //
  //        return ans;
  //    }
      static int size;
  
      public static void swap(int[] arr,int x,int y)
      {
          int temp=arr[x];
          arr[x]=arr[y];
          arr[y]=temp;
      }
  
  
      public static void delete(int[] arr)
      {
          swap(arr,0,size-1);
          --size;
          heapify(arr,0);
      }
  
      public static void heapify(int[] arr,int x)
      {
          int largest=x;
          int left_child=2*x;
          int right_child=2*x+1;
  
          if(left_child<size && arr[left_child]>arr[largest])
              largest=left_child;
          if(right_child<size && arr[right_child]>arr[largest])
              largest=right_child;
  
          if(largest!=x)
          {
              swap(arr,x,largest);
              heapify(arr,largest);
          }
      }
  
      public static int check(ArrayList<Integer> arr,int N,int X)
      {
          int l=0,r=N-1;
          while(l<=r)
          {
              int mid=(l+r)/2;
  
              if(arr.get(mid)<=X)
              {
  
                  if(mid+1<N && arr.get(mid+1)<=X)
                      l=mid+1;
                  else
                      return mid;
              }
              else
                  r=mid-1;
          }
  
          return -1;
      }
  
      public static cord check(ArrayList<Integer> arr)
      {
         int initial=0,level=0;
         int index=0;
         for(int i=0;i<arr.size();i++)
         {
             if(arr.get(i)<level)
                 level+=1;
             else
             {
                 initial+=arr.get(i)-level+1;
                 level=arr.get(i)+1;
                 level+=1;
             }
             //System.out.println(level+" "+i+" "+initial);
         }
  
         return new cord(initial,initial+arr.size());
      }
  
      public static boolean vowel(char ch)
      {
          if(ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch=='u')
              return true;
          return false;
      }
  
      public static int check(String s,int start)
      {
          if(start==s.length())
              return 0;
          if(vowel(s.charAt(start)))
              return 1+check(s,start+1);
          else
              return check(s,start+1);
  
  
      }
  
  
  
  
  
  
  
  
  
  
  
  
  
      public static void main(String[] args)throws IOException
      {
          Reader.init(System.in);
          BufferedWriter output=new BufferedWriter(new OutputStreamWriter(System.out));
          int T=Reader.nextInt();
          A:for(int m=1;m<=T;m++)
          {
              int digits=Reader.nextInt();
              String s=Reader.next();
              if(digits==1)
              {
                  output.write(1+"\n");
                  output.write(s+"\n");
                  continue;
              }
              int[] visited=new int[10];
              for(int i=0;i<digits;i++)
              {
                  char ch=s.charAt(i);
                  int num=ch-48;
                  visited[num]++;
              }
  
              for(int i=1;i<=9;i++)
              {
                  if(i==3 || i==5 || i==7 || i==2)
                      continue;
                  if(visited[i]>0)
                  {
                      output.write(1+"\n");
                      output.write(i+"\n");
                      continue A;
                  }
              }
              if(s.length()==2)
              {
                  output.write(2+"\n");
                  output.write(s+"\n");
                  continue;
              }
  
              int index_2=s.indexOf('2',1);
              if(index_2!=-1)
              {
                  output.write(2+"\n");
                  output.write(s.charAt(index_2-1)+"2"+"\n");
                  continue A;
              }
  
              for(int i=0;i<digits-1;i++)
              {
                  if(s.charAt(i)=='2' && s.charAt(i+1)!='3')
                  {
                      output.write(2+"\n");
                      output.write("2"+s.charAt(i+1)+"\n");
                      continue A;
                  }
                  if(s.charAt(i)=='5' && s.charAt(i+1)!='3')
                  {
                      output.write(2+"\n");
                      output.write("5"+s.charAt(i+1)+"\n");
                      continue A;
                  }
                  if(s.charAt(i)=='7' && s.charAt(i+1)!='3')
                  {
                      output.write(2+"\n");
                      output.write("7"+s.charAt(i+1)+"\n");
                      continue A;
                  }
                  if(s.charAt(i)=='3' && s.charAt(i+1)!='7')
                  {
                      output.write(2+"\n");
                      output.write("3"+s.charAt(i+1)+"\n");
                      continue A;
                  }
              }
  
              if(s.charAt(0)=='5')
              {
                  if(s.length()>2)
                  {
                      output.write(2+"\n");
                      output.write(57+"\n");
                  }
  
  
              }
              else if(s.charAt(0)=='2')
              {
                  if(s.length()>2)
                  {
                      output.write(2+"\n");
                      output.write(27+"\n");
                  }
  
              }
              else if(s.charAt(0)=='3')
              {
  
                      output.write(2+"\n");
                      output.write(33+"\n");
  
              }
              else
              {
                  output.write(2+"\n");
                  output.write(77+"\n");
              }
  
  
          }
  
  
  
  
  
  
          output.flush();
  
      }
  }
  
  class cord
  {
      int x;
      int y;
      cord(int x,int y)
      {
          this.x=x;
          this.y=y;
      }
  }
  
  class cp
  {
      int a,b;
      cp(int a,int b)
      {
          this.a=a;
          this.b=b;
  
      }
  }
  
  class sort_cp implements Comparator<cp>
  {
      public int compare(cp o1,cp o2)
      {
          return o2.b-o1.b;
      }
  }
  class g_node{
      int val;
      long wt;
  
      g_node(int val, long wt)
      {
          this.val = val;
          this.wt = wt;
      }
  }
  class Reader {
      static BufferedReader reader;
      static StringTokenizer tokenizer;
  
      static void init(InputStream input) {
          reader = new BufferedReader(
                  new InputStreamReader(input));
          tokenizer = new StringTokenizer("");
      }
  
      static String next() throws IOException {
          while (!tokenizer.hasMoreTokens()) {
              tokenizer = new StringTokenizer(
                      reader.readLine());
          }
          return tokenizer.nextToken();
      }
  
      static int nextInt() throws IOException {
          return Integer.parseInt(next());
      }
  
      static long nextLong() throws IOException {
          return Long.parseLong(next());
      }
  
      static double nextDouble() throws IOException {
          return Double.parseDouble(next());
      }
  }