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.util.*;
  import java.io.*;
  
  public class B {
      static StringBuilder sb = new StringBuilder();
  
      public static class F {
          static StringBuilder sb;
          static long fact[];
          static int mod = (int) (1e9 + 7);
          static int[] arr = { 0, 1, 11, 111, 1111, 11111, 111111, 1111111, 11111111, 111111111, 1111111111 };
  
          static void solve() {
              long l = l();
              long r = l();
              long count = 0;
              if (l == r) {
                  sb.append("0\n");
                  return;
              }
  
              String st = r + "";
  
              int len = st.length();
              for (int i = 0; i < st.length(); i++) {
                  count = count + ((st.charAt(i) - '0') * arr[len]);
                  len--;
              }
  
              String st1 = l + "";
              int len1 = st1.length();
              for (int i = 0; i < st1.length(); i++) {
                  count = count - ((st1.charAt(i) - '0') * arr[len1]);
                  len1--;
              }
  
              sb.append(count + "\n");
          }
  
          public static void main(String[] args) {
              sb = new StringBuilder();
              int test = i();
              while (test-- > 0) {
                  solve();
              }
              System.out.println(sb);
  
          }
  
          /*
           * fact=new long[(int)1e6+10]; fact[0]=fact[1]=1; for(int i=2;i<fact.length;i++)
           * { fact[i]=((long)(i%mod)1L(long)(fact[i-1]%mod))%mod; }
           */
          // **************NCR%P******************
  
          static long p(long x, long y)// POWER FXN //
          {
              if (y == 0)
                  return 1;
  
              long res = 1;
              while (y > 0) {
                  if (y % 2 == 1) {
                      res = (res * x) % mod;
                      y--;
                  }
  
                  x = (x * x) % mod;
                  y = y / 2;
  
              }
              return res;
          }
  
          static long ncr(int n, int r) {
              if (r > n)
                  return (long) 0;
  
              long res = fact[n] % mod;
              // System.out.println(res);
              res = ((long) (res % mod) * (long) (p(fact[r], mod - 2) % mod)) % mod;
              res = ((long) (res % mod) * (long) (p(fact[n - r], mod - 2) % mod)) % mod;
              // System.out.println(res);
              return res;
  
          }
  
          // **************END******************
  
          // *************Disjoint set
          // union*********//
  
          // ***************PRIME FACTORIZE
          // ***********************************//
          static TreeMap<Integer, Integer> prime(long n) {
              TreeMap<Integer, Integer> h = new TreeMap<>();
              long num = n;
              for (int i = 2; i <= Math.sqrt(num); i++) {
                  if (n % i == 0) {
                      int nt = 0;
                      while (n % i == 0) {
                          n = n / i;
                          nt++;
                      }
                      h.put(i, nt);
                  }
              }
              if (n != 1)
                  h.put((int) n, 1);
              return h;
  
          }
  
          // *****CLASS PAIR
          // *************************************************
          static class Pair implements Comparable<Pair> {
              int x;
              long y;
  
              Pair(int x, long y) {
                  this.x = x;
                  this.y = y;
              }
  
              public int compareTo(Pair o) {
                  return (int) (this.y - o.y);
  
              }
  
          }
          // *****CLASS PAIR
          // ***************************************************
  
          static class InputReader {
              private InputStream stream;
              private byte[] buf = new byte[1024];
              private int curChar;
              private int numChars;
              private SpaceCharFilter filter;
  
              public InputReader(InputStream stream) {
                  this.stream = stream;
              }
  
              public int read() {
                  if (numChars == -1)
                      throw new InputMismatchException();
                  if (curChar >= numChars) {
                      curChar = 0;
                      try {
                          numChars = stream.read(buf);
                      } catch (IOException e) {
                          throw new InputMismatchException();
                      }
                      if (numChars <= 0)
                          return -1;
                  }
                  return buf[curChar++];
              }
  
              public int Int() {
                  int c = read();
                  while (isSpaceChar(c))
                      c = read();
                  int sgn = 1;
                  if (c == '-') {
                      sgn = -1;
                      c = read();
                  }
                  int res = 0;
                  do {
                      if (c < '0' || c > '9')
                          throw new InputMismatchException();
                      res *= 10;
                      res += c - '0';
                      c = read();
                  } while (!isSpaceChar(c));
                  return res * sgn;
              }
  
              public String String() {
                  int c = read();
                  while (isSpaceChar(c))
                      c = read();
                  StringBuilder res = new StringBuilder();
                  do {
                      res.appendCodePoint(c);
                      c = read();
                  } while (!isSpaceChar(c));
                  return res.toString();
              }
  
              public boolean isSpaceChar(int c) {
                  if (filter != null)
                      return filter.isSpaceChar(c);
                  return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
              }
  
              public String next() {
                  return String();
              }
  
              public interface SpaceCharFilter {
                  public boolean isSpaceChar(int ch);
              }
          }
  
          static class OutputWriter {
              private final PrintWriter writer;
  
              public OutputWriter(OutputStream outputStream) {
                  writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
              }
  
              public OutputWriter(Writer writer) {
                  this.writer = new PrintWriter(writer);
              }
  
              public void print(Object... objects) {
                  for (int i = 0; i < objects.length; i++) {
                      if (i != 0)
                          writer.print(' ');
                      writer.print(objects[i]);
                  }
              }
  
              public void printLine(Object... objects) {
                  print(objects);
                  writer.println();
              }
  
              public void close() {
                  writer.close();
              }
  
              public void flush() {
                  writer.flush();
              }
          }
  
          static InputReader in = new InputReader(System.in);
          static OutputWriter out = new OutputWriter(System.out);
  
          public static long[] sortlong(long[] a2) {
              int n = a2.length;
              ArrayList<Long> l = new ArrayList<>();
              for (long i : a2)
                  l.add(i);
              Collections.sort(l);
              for (int i = 0; i < l.size(); i++)
                  a2[i] = l.get(i);
              return a2;
          }
  
          public static int[] sortint(int[] a2) {
              int n = a2.length;
              ArrayList<Integer> l = new ArrayList<>();
              for (int i : a2)
                  l.add(i);
              Collections.sort(l);
              for (int i = 0; i < l.size(); i++)
                  a2[i] = l.get(i);
              return a2;
          }
  
          public static long pow(long x, long y) {
              long res = 1;
              while (y > 0) {
                  if (y % 2 != 0) {
                      res = (res * x);// % modulus;
                      y--;
  
                  }
                  x = (x * x);// % modulus;
                  y = y / 2;
              }
              return res;
          }
  
          // GCD___+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
          public static long gcd(long x, long y) {
              if (x == 0)
                  return y;
              else
                  return gcd(y % x, x);
          }
          // ******LOWEST COMMON MULTIPLE
          // *********************************************
  
          public static long lcm(long x, long y) {
              return (x * (y / gcd(x, y)));
          }
  
          // INPUT
          // PATTERN********************************************************
          public static int i() {
              return in.Int();
          }
  
          public static long l() {
              String s = in.String();
              return Long.parseLong(s);
          }
  
          public static String s() {
              return in.String();
          }
  
          public static int[] readArray(int n) {
              int A[] = new int[n];
              for (int i = 0; i < n; i++) {
                  A[i] = i();
              }
              return A;
          }
  
          public static long[] readArray(long n) {
              long A[] = new long[(int) n];
              for (int i = 0; i < n; i++) {
                  A[i] = l();
              }
              return A;
          }
  
      }
  
      static String[] arr = { "1", "4", "6", "8", "9", "22", "25", "27", "32", "33", "35", "52", "55", "57", "72", "75",
              "77" };
  
      static boolean contains(String s, String t, int[][] dp, int n, int m) {
          if (n == 0 || m == 0) {
              if (m == 0)
                  return true;
  
              return false;
          }
  
          if (dp[n][m] != -1)
              return dp[n][m] == 1;
  
          boolean res = false;
  
          if (s.charAt(n - 1) == t.charAt(m - 1)) {
              res = contains(s, t, dp, n - 1, m - 1);
          } else {
              res = contains(s, t, dp, n - 1, m);
          }
  
          if (res) {
              dp[n][m] = 1;
          } else
              dp[n][m] = 0;
  
          return res;
  
      }
  
      static String solve(String num) {
          int n = num.length();
          int m = 2;
          int[][] dp = new int[n + 1][m + 1];
          for (String str : arr) {
              for (int[] d : dp)
                  Arrays.fill(d, -1);
              boolean res = contains(num, str, dp, n, str.length());
  
              if (res)
                  return str;
          }
  
          return "";
  
      }
  
      public static void main(String[] args) {
  
          int t = F.i();
          while (t-- > 0) {
              int k = F.i();
              String num = F.s().trim();
              String ans = solve(num);
              System.out.println(ans.length());
              System.out.println(ans);
          }
  
      }
  }