#include using namespace std; #define rep(i,n) for(int i=0;i=0;i--) #define fi first #define se second #define pb push_back #define sz(a) (int)a.size() #define vec(...) vector<__VA_ARGS__> #define _3ulnVOy ios::sync_with_stdio(0),cin.tie(0) typedef long long ll; using pii=pair; using vi=vec(int); void print(){cout<<"\n";} template void print(const T&v,const E&...u){cout<>s; int mi=9,ma=0; rep(i,3){ int x=s[i]-'0'; ma=max(ma,x); mi=min(mi,x); } print(ma-mi); } signed main(){ _3ulnVOy; int t=1; // cin>>t; rep(cs,t){ slv(); } // return 0; }