Kattis Challenge "A Different Problem"

Problem

My solution

 1import java.util.Scanner;
 2
 3public class Kattis {
 4
 5    public static void main(String[] args) {
 6
 7        Scanner sc = new Scanner(System.in);
 8
 9        while (sc.hasNext()) {
10
11            long X = sc.nextLong();
12            long Y = sc.nextLong();
13
14            if (X > Y) {
15                System.out.println(Math.abs(X - Y));
16
17            } else {
18                System.out.println(Math.abs(X - Y));
19
20            }
21        }
22    }
23}