1.
/**
* Angewandte Mathematik, SS11
* Problem: 10055 - Hashmat the Brave Warrior
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=996
*
* @author Markus Schöllner
* @author Andreas Maier
* @version 1.0, 04/12/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 2.720
*/

import java.math.*;
import java.util.*;

public class Main {
public static void main(String[] args){

Scanner input = new Scanner(System.in);

while(input.hasNext()){
BigInteger number1 = input.nextBigInteger();
BigInteger number2 = input.nextBigInteger();
System.out.println(number2.subtract(number1).abs());
}
}
}

2.

import java.util.Scanner;
/**
 * Angewandte Mathematik, SS11
 * Problem: 10055 - Hashmat the Brave Warrior
 * Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=996


 *
 * @author Gent Selmanaj
 * @author Marco Schuster
 * @author Chris Westerfield
 * @version 1.0, 2011-04-12
 *
 * Method :
 * Status : Accepted (#8739028)
 * Runtime: 2.660
 */

public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String[] l = sc.nextLine().split(" ");

            Long a = Long.valueOf(l[0]);


            Long b = Long.valueOf(l[1]);
            Long d = Math.abs(b - a);
            System.out.println(d.toString());
        }

    }
}

3.

/**
* FWP, Angewandte Mathematik, SS11
* Problem: 10055 - Hashmat the Brave Warrior
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=996
*
* @author Sebastian Stumpf
* @author Benjamin Vogt
* @version 1.0, 2011-04-20 21:02:25
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 1.396
*/

import java.io.*;
import java.util.*;

public class Main
{
public static void main(String[] args) throws Exception
{
long att;
long opp;
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
do
{
// isnt there a possibility in java that is faster than both versions below??
// version with split is markable slower
// String[] sA = input.readLine().split( " ");
// att = Long.valueOf(sA[0]);
// opp = Long.valueOf(sA[1]);
StringTokenizer tokenizer = new StringTokenizer(input.readLine());
att = Long.valueOf(tokenizer.nextToken());
opp = Long.valueOf(tokenizer.nextToken());
System.out.println(Math.abs(opp-att));
}while(input.ready());
}
}