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