#include <stdio.h>
#include <math.h>
#include<bits/stdc++.h>
using namespace std;
main()
{
while(1)
{
{
long long cnt=0,cnt1=0,diff,ans=0,i,a,ar[1010]={0},mn=10000000,i1,flag=0;
while(cin>>a)
{
if(a==0&&cnt==0)
{
flag=1;
break;
}
if(a==0&&cnt>0)
break;
else
{
ar[cnt]=a;
cnt++;
}
}
if(flag==0)
{
for(i=1;i<cnt;i++)
{
diff=ar[i]-ar[i-1];
ans=__gcd(ans,diff);
}
if(ans>=0)
cout<<ans<<endl;
else
cout<<abs(ans)<<endl;
}
else
break;
}
}
}
#include <math.h>
#include<bits/stdc++.h>
using namespace std;
main()
{
while(1)
{
{
long long cnt=0,cnt1=0,diff,ans=0,i,a,ar[1010]={0},mn=10000000,i1,flag=0;
while(cin>>a)
{
if(a==0&&cnt==0)
{
flag=1;
break;
}
if(a==0&&cnt>0)
break;
else
{
ar[cnt]=a;
cnt++;
}
}
if(flag==0)
{
for(i=1;i<cnt;i++)
{
diff=ar[i]-ar[i-1];
ans=__gcd(ans,diff);
}
if(ans>=0)
cout<<ans<<endl;
else
cout<<abs(ans)<<endl;
}
else
break;
}
}
}