Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- public class Main {
- public static void main(String[] args) throws IOException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- String [] domino1 = reader.readLine().split(" ");
- String [] domino2 = reader.readLine().split(" ");
- int a = Integer.parseInt(domino1[0]);
- int b = Integer.parseInt(domino1[1]);
- int x = Integer.parseInt(domino2[0]);
- int y = Integer.parseInt(domino2[1]);
- if (a == x) {
- System.out.println(b + " " + a + " " + x + " " + y);
- }
- else if (a == y) {
- System.out.println(b + " " + a + " " + y + " " + x);
- }
- else if (b == x) {
- System.out.println(a + " " + b + " " + x + " " + y);
- }
- else if (b == y) {
- System.out.println(a + " " + b + " " + y + " " + x);
- }
- else {
- System.out.println(-1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement