text: For more clarifications please look at the second sample test that demonstrates the example given in the problem statement.<image> Output Print the scheme of decorating the box with stones: two lines containing two space-separated integers from 1 to 9.The numbers should be pairwise different.If there is no solution for the given lock, then print the single number "-1" (without the quotes).If there are several solutions, output any.Examples Input 3 7 4 6 5 5 Output 1 2 3 4 Input 11 10 13 8 5 16 Output 4 7 9 1 Input 1 2 3 4 5 6 Output -1 Input 10 10 10 10 10 10 Output -1 Note Pay attention to the last test from the statement: it is impossible to open the box because for that Vasilisa the Wise would need 4 identical gems containing number "5".However, Vasilisa only has one gem with each number from 1 to 9.# Solution import java.util.Scanner; public class HelpVasilisaTheWise { public static void main (String [] args) { Scanner in = new Scanner(System.in); int r1 = in.nextInt(); int r2 = in.nextInt(); int c1 = in.nextInt(); int c2 = in.nextInt(); int d1 = in.nextInt(); int d2 = in.nextInt(); int a1=0, a2=0, a3=0, a4=0; boolean sw = true; for (int i=1; i<=9; i++) { a1 = i; a2 = r1 - a1; a3 = c1 - a1; a4 = d1 - a1; if( r2 == a3 + a4 && c2 == a2 + a4 && d2 == a3 + a2 ) { if( !(a2 < 1 || a3 < 1 || a4 < 1 || a2 > 9 || a3 > 9 || a4 > 9 || a1 == a2 || a1 == a3 || a1 == a4 || a2 == a3 || a2 == a4 || a3 == a4) ) { System.out.println(a1 + " " + a2); System.out.println(a3 + " " + a4); sw = false; break; } } } if (sw) { System.out.println("-1"); } } }