Algorithm – Collatz Conjecture encounters two numbers in Java and receives the wrong answer

I literally have several test cases, it's over, I even fixed TLE with Long. Could someone help me figure out what I'm doing wrong?
Below is my code:

import java.io.BufferedReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

public class CollatzConjecture {

    public static void printAnswer(long a,long aSteps, long b, long bSteps, long meet) {
        System.out.println(a + " needs " + aSteps + " steps, " + b + " needs " + bSteps + " steps, they meet at " + meet);
    }

    public static void main(String() args) {
        long a,b;
        Scanner in = new Scanner(System.in);

        a = in.nextInt();
        b = in.nextInt();
        HashMap aList = new HashMap();
        HashMap bList = new HashMap();

        while(a!=0 && b!= 0) {
            long answerStepsA = 0, answerStepsB = 0, meet = 0;
            long originalA = a;
            long originalB = b;
            long aSteps = 0, bSteps = 0;
            boolean answerFound = false;
            aList.put(originalA, aSteps);
            bList.put(originalB, bSteps);
            if(a==1 && b==1) {
                printAnswer(a,0,b,0,1);
            }
            if(a==b) {
                printAnswer(originalA, 0, originalB, 0, originalA);
            }
            else {
                while(a!=1) {
                    if (a%2 == 1){
                        a = 3 * a + 1;
                        aList.put(a, aSteps);
                    }
                    else {
                        a /= 2;
                        aList.put(a, aSteps);
                    }
                    aSteps+=1;
                    if(aList.containsKey(b)) {
                        answerStepsA = aSteps;
                        answerStepsB = bSteps;
                        meet = b;
                        // printAnswer(originalA, aSteps, originalB, bSteps, b);
                        answerFound = true;
                        break;
                    }
                }
                while(b!=1 && !answerFound) {
                    if(b%2 == 1) {
                        b = 3 * b + 1;
                    }
                    else {
                        b/=2;
                    }
                    bSteps+=1;
                    if(aList.containsKey(b)) {
                        answerStepsA = aList.get(b) + 1;
                        answerStepsB = bSteps;
                        meet = b;
                        // printAnswer(originalA, aList.get(b) + 1, originalB, bSteps, b);
                        answerFound = true;
                        break;
                    }

                }
                if(answerFound) {
                    printAnswer(originalA, answerStepsA, originalB, answerStepsB, meet);
                }
            }

            answerFound = false;
            aSteps = bSteps = answerStepsA = answerStepsB = 0;
            aList.clear();
            bList.clear();
            a = in.nextInt();
            b = in.nextInt();
        }
    }
}