import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long longestSequence(long[] a) { ArrayList fResult = new ArrayList(); for(int z = 0; z < a.length; z++){ long num = a[z]; // Return the length of the longest possible sequence of moves. ArrayList result = new ArrayList(); while(num%2 == 0){ long two = 2; result.add(two); num = num/2; } for (long i =3; i<= Math.sqrt(num);i+=2){ while(num % i == 0){ result.add(i); num = num / i; } } if (num > 2) result.add(num); long output = 0; long n = a[z]; for (int i =0 ; i