public class diff{
	public static void main(String arg[]){
		int a[] = null;
		int b[] = null;
		if (arg.length>1){
			try{
				a = toDecimalArray(arg[0]);
				b = toDecimalArray(arg[1]);
			} catch(NumberFormatException e){
				System.err.println("Invalid input");
				System.exit(1);
			} 
		} else{
			System.err.println("Usage: diff a b");
			System.exit(1);
		}

		int max =  trueLength(a);
		if (trueLength(b) > max) max = trueLength(b);
		System.out.print(' ');		
		System.out.println(toDecimalString(a, max));
		System.out.print(' ');
		System.out.println(toDecimalString(b, max));
		int sign = 1;
		int na = trueLength(a);
		int nb = trueLength(b);
		if (nb > na){
			int[] tmp = a;
			a = b;
			b = tmp;
			sign =  -1;
		}else if (na == nb){
			int i = na;
			while (i > 0 && a[i-1] == b[i-1]) i--;
			//now i = 0 and a = b, or i > 0 and a[i-1] is not the same as b[i-1]
			if (i > 0 && a[i-1] < b[i-1]){
			//a smaller than b
				int[] tmp = a;
				a = b;
				b = tmp;
				sign = -1;
			}
		}

		int c[] = sub(a, b);

		if (sign < 0) System.out.print('-');
		else System.out.print(' ');
		System.out.println(toDecimalString(c, max));
	}

	static int trueLength(int x[]){
		int n = x.length;
		while (n > 0 && x[n-1] == 0) n--;
		return(n);
	}

	static int[] toDecimalArray(String s) throws NumberFormatException{
		s.trim();
		int n = s.length();
		int a[] = new int[n];
		for (int i=0;i<n;i++){
			char c = s.charAt(i);
			if ('0' <= c && c<= '9') a[n-i-1] = c - '0';
			else throw new NumberFormatException();
		}
		return(a);
	}

		static String toDecimalString(int a[]){
			int n = a.length;
			while (n > 0 && a[n-1] == 0){
			n--;
		}
		if (n == 0) return("0");
		String s ="";
		for (int i=n;i>0;i--){
			s = s + (char)('0' + a[i-1]);
		}
		return(s);
	}

	static String toDecimalString(int a[], int w){
		String s = "";
		int n = trueLength(a);
		int k = w-n;
		if (n == 0){
			k --;
		}
		if (w > n){
			for (int i=0;i<k;i++){
				s += ' ';
			}
		}
		s += toDecimalString(a);
		return(s);
	}

	static int [] sub(int x[], int y[]){
	
		int z[] = new int[x.length+1];
		int borrow = 0;
		for (int i=0;i<y.length;i++){
			int s = x[i] - y[i] - borrow;
			if s = sign["-"]{
				z[i] = s + 10;
				borrow = x[i+1] - 1;
			}		
}	
		for (int i=y.length;i<x.length;i++){
			int s = x[i] - borrow;
			if s = sign["-"]{
				z[i] = s + 10;
				borrow = x[i+1] - 1;
			}		
}
		z[x.length] = borrow;
		return(z);
	}
}
		