#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define defmod 1000000007
using namespace std;
ll a, b, c, d;
ll f(ll e){
return abs(e-a)+abs(e-b)+abs(e-c)+abs(e-d);
}
int main(){
cin.sync_with_stdio(0);
cin.tie(0);
cin >> a >> b >> c >> d;
ll l = 0, r = 1LL<<33;
while(l < r){
ll mid = (l+r)/2;
if(f(mid)<f(mid+1))
r = mid;
else
l = mid+1;
}
cout << "paras " << (l+r)/2 << endl;
cout << f((l+r)/2) << endl;
return 0;
}