public static void solver(int input) {
   int leftVal = 0;
   int rightVal = 0;
   boolean leftFlag = false;
   boolean rightFlag = false;
   int valIn = input;
   
   while(leftFlag == false || rightFlag == false) {
     //left
     if(leftFlag == false) {
       if(checkLeft(valIn)) {
         leftVal = valIn;
         leftFlag = true;
       }
     }
     //right
     if(rightFlag == false) {
       if(checkRight(valIn)) {
         rightVal = valIn;
         rightFlag = true;
       }
     }
     //clean up
     valIn--;
   }
   
   System.out.println(leftVal);
   System.out.println(rightVal);
  }