import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int[] costlyIntervals(int n, int k, int[] A) { int R[] = new int[A.length]; for(int i = 0; i < R.length; i++){ R[i] = -1; } for(int i = 0; i < n; i++){ for(int j = i; j < n; j++){ int l = A[i]; int r = A[j]; int cost = ((l | r) - (l & r)) - Math.abs(l - r); if (cost >= k && j-i > R[i] && j - i > R[j]){ R[j] = j - i + 1; R[i] = j - i + 1; } } } return R; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); int[] A = new int[n]; for(int A_i = 0; A_i < n; A_i++){ A[A_i] = in.nextInt(); } int[] result = costlyIntervals(n, k, A); for (int i = 0; i < result.length; i++) { System.out.print(result[i] + (i != result.length - 1 ? "\n" : "")); } System.out.println(""); in.close(); } }