#include <iostream>
#include <cmath>
using namespace std;
int main() {
int b1, b2, b3, need, pas;
cin >> b1 >> b2 >> b3;
need = (b1 + b2 + b3) / 3;
if ((b1 + b2 + b3) % 3!=0) {
cout << "IMPOSSIBLE";
return 0;
}
else cout << (abs(b1 - need) + abs(b2 - need) + abs(b3 - need))/2;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCWludCBiMSwgYjIsIGIzLCBuZWVkLCBwYXM7CgljaW4gPj4gYjEgPj4gYjIgPj4gYjM7CgluZWVkID0gKGIxICsgYjIgKyBiMykgLyAzOwoJaWYgKChiMSArIGIyICsgYjMpICUgMyE9MCkgewoJCWNvdXQgPDwgIklNUE9TU0lCTEUiOwoJCXJldHVybiAwOwoJfQoJZWxzZSBjb3V0IDw8IChhYnMoYjEgLSBuZWVkKSArIGFicyhiMiAtIG5lZWQpICsgYWJzKGIzIC0gbmVlZCkpLzI7CglyZXR1cm4gMDsKfQ==