import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static boolean prime(long n) { // Corner cases if (n <= 1) return false; if (n <= 3) return true; // This is checked so that we can skip // middle five numbers in below loop if (n%2 == 0 || n%3 == 0) return false; for (int i=5; i*i<=n; i=i+6) if (n%i == 0 || n%(i+2) == 0) return false; return true; } static long divisor(long x) { long div=1; if (!prime(x)) { for (long i=2;i<=Math.sqrt(x);i++) { if (x%i==0) { div=x/i; break; } } } return div; } static long longestSequence(long[] a) { // Return the length of the longest possible sequence of moves. long moves=0; for (int i=0;i