#include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,x;
cin>>a>>b>>x;
cout<<min(abs(x-a),abs(x-b));
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpewoJCiAgICBpbnQgYSxiLHg7CiAgICBjaW4+PmE+PmI+Png7CiAgICAKCWNvdXQ8PG1pbihhYnMoeC1hKSxhYnMoeC1iKSk7CgoJcmV0dXJuIDA7Cn0=