package no015; import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int s = sc.nextInt(); int[] p = new int[n]; for(int i=0;i g1 = new ArrayList<>(); ArrayList g2 = new ArrayList<>(); int n1 = n/2; int n2 = n - n1; for(int i=0;i<1<>j&1) == 1) { sum += p[n1-1-j]; } } g1.add(new Pair(sum,(long) i<>j&1) == 1) { sum += p[n-1-j]; } } g2.add(new Pair(sum,i)); } Collections.sort(g1); Collections.sort(g2); ArrayList ans = new ArrayList<>(); int j = (1<= 0 && g1.get(i).sum + g2.get(j).sum > s) { j--; } int j2 = j; while(j >= 0 && g1.get(i).sum + g2.get(j).sum == s) { ans.add(g1.get(i).i + g2.get(j).i); j--; } j = j2; } Collections.sort(ans,Collections.reverseOrder()); for(long l:ans) { ArrayList items = new ArrayList<>(); for(int i=0;i>i&1)==1) { items.add(n-1-i); } } Collections.reverse(items); StringBuilder sb = new StringBuilder(); for(int i=0;i= 1) { sb.append(' '); } sb.append(items.get(i) + 1); } System.out.println(sb.toString()); } } static class Pair implements Comparable{ long i; int sum; public Pair(int sum,long i) { this.sum = sum; this.i = i; } @Override public int compareTo(Pair o) { return Integer.compare(sum, o.sum); } } }