import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int S= sc.nextInt(); ArrayList p1 = new ArrayList<>(); ArrayList p2 = new ArrayList<>(); HashMap>> n1 = new HashMap<>(); HashMap>> n2 = new HashMap<>(); for(int i=0;i=0;i--){ int sum=0; ArrayList temp = new ArrayList<>(); for(int j=0;j>()); n1.get(sum).add(temp); } for(int i=(1<=0;i--){ int sum=0; ArrayList temp = new ArrayList<>(); for(int j=0;j>()); n2.get(sum).add(temp); } for(int a:n1.keySet()){ if(n2.containsKey(S-a)){ for(ArrayList f:n1.get(a)){ for(ArrayList g:n2.get(S-a)){ String q =""; for(int r:f){ q+=r+" "; } for(int t : g){ q+=t+" "; } System.out.println(q.trim()); } } } } } }