Neko loves divisors. During the latest number theory lesson, he got an interesting exercise from his math teacher.

Neko has two integers a and b. His goal is to find a non-negative integer k such that the least common multiple of a+k and b+k is the smallest possible. If there are multiple optimal integers k, he needs to choose the smallest one.

Given his mathematical talent, Neko had no trouble getting Wrong Answer on this problem. Can you help him solve it?

Input

The only line contains two integers a and b (1 ≤ a, b ≤ 10^9).

Output

Print the smallest non-negative integer k (k ≥ 0) such that the lowest common multiple of a+k and b+k is the smallest possible.

If there are many possible integers k giving the same value of the least common multiple, print the smallest one.

Examples

Input


6 10


Output


2

Input


21 31


Output


9

Input


5 10


Output


0

Note

In the first test, one should choose k = 2, as the least common multiple of 6 + 2 and 10 + 2 is 24, which is the smallest least common multiple possible.
import java.util.*;
import java.io.*;

public class C
{

	static FastIO f;

	public static void main(String args[]) throws IOException
	{
		f = new FastIO();

		long a = f.nl(), b = f.nl();

		f.out(solve(a, b) + "\n");

		f.flush();
	}

	public static long solve(long a, long b)
	{
		long d = Math.abs(b-a);

		HashSet<Long> h = getDivisor(d);

		long lcm = (a*b)/gcd(a, b), ans = 0, x, t;

		for(Long i : h)
		{
			x = i - a%i;

			if(x == 0)
				continue;

			t = ((a+x)*(b+x))/gcd(a+x, b+x);

			if(t < lcm)
			{
				ans = x;
				lcm = t;
			}
		}

		return ans;
	}

	public static HashSet<Long> getDivisor(long d)
	{
		HashSet<Long> h = new HashSet<>();

		for(long i = 1L; i*i <= d; i++)
		{
			if(d%i == 0L)
			{
				h.add(i);
				h.add(d/i);
			}
		}

		return h;
	}

	public static long gcd(long a, long b)
	{
		return b==0 ? a : gcd(b, a%b);
	}
	public static long pow(long x, long y, long mod)
	{
		long res = 1L;
		x %= mod;
	
		while(y > 0)
		{
			if((y&1) == 1)
				res = (res*x)%mod;
			x = (x*x)%mod;
			y >>= 1;
		}
	
		return res;
	}

	public static class FastIO
	{
		BufferedReader br;
		BufferedWriter bw, be;
		StringTokenizer st;

		public FastIO()
		{
			br = new BufferedReader(new InputStreamReader(System.in));
			bw = new BufferedWriter(new OutputStreamWriter(System.out));
			be = new BufferedWriter(new OutputStreamWriter(System.err));
			st = new StringTokenizer("");
		}

		private void read() throws IOException
		{
			st = new StringTokenizer(br.readLine());
		}

		public String ns() throws IOException
		{
			while(!st.hasMoreTokens())
				read();
			return st.nextToken();
		}

		public int ni() throws IOException
		{
			return Integer.parseInt(ns());
		}

		public long nl() throws IOException
		{
			return Long.parseLong(ns());
		}

		public float nf() throws IOException
		{
			return Float.parseFloat(ns());
		}

		public double nd() throws IOException
		{
			return Double.parseDouble(ns());
		}

		public char nc() throws IOException
		{
			return ns().charAt(0);
		}

		public int[] nia(int n) throws IOException
		{
			int[] a = new int[n];
			for(int i = 0; i < n; i++)
				a[i] = ni();

			return a;
		}

		public long[] nla(int n) throws IOException
		{
			long[] a = new long[n];
			for(int i = 0; i < n; i++)
				a[i] = nl();

			return a;
		}

		public char[] nca() throws IOException
		{
			return ns().toCharArray();
		}

		public void out(String s) throws IOException
		{
			bw.write(s);
		}

		public void flush() throws IOException
		{
			bw.flush();
			be.flush();
		}

		public void err(String s) throws IOException
		{
			be.write(s);
		}
	}
}