function movimientos() {
var input = readline();
var splited = input.split(',');
const x1 = splited[0];
const x2 = splited[1];
const y1 = splited[2];
const y2 = splited[3];
console.log('inputs', splited);
if (x1 === x2 && y1 === y2) {
return 0;
}
const moves = [
[-2, -1], [-1, -2], [1, -2], [2, -1],
[2, 1], [1, 2], [-1, 2], [-2, 1]
];
const queue = [[x1, y1, 0]];
const visited = new Set([`${x1},${y1}`]);
while (queue.length > 0) {
const [x, y, jumps] = queue.shift();
for (const [dx, dy] of moves) {
const nx = x + dx;
const ny = y + dy;
if (nx === x2 && ny === y2) {
return jumps + 1;
}
const key = `${nx},${ny}`;
if (nx >= -200 && nx <= 200 && ny >= -200 && ny <= 200 && !visited.has(key)) {
visited.add(key);
queue.push([nx, ny, jumps + 1]);
}
}
}
return "IMPOSSIBLE";
}
console.log(movimientos());
ZnVuY3Rpb24gbW92aW1pZW50b3MoKSB7CiAgdmFyIGlucHV0ID0gcmVhZGxpbmUoKTsKICB2YXIgc3BsaXRlZCA9IGlucHV0LnNwbGl0KCcsJyk7CiAgY29uc3QgeDEgPSBzcGxpdGVkWzBdOwogIGNvbnN0IHgyID0gc3BsaXRlZFsxXTsKICBjb25zdCB5MSA9IHNwbGl0ZWRbMl07CiAgY29uc3QgeTIgPSBzcGxpdGVkWzNdOwogIGNvbnNvbGUubG9nKCdpbnB1dHMnLCBzcGxpdGVkKTsKICAKICBpZiAoeDEgPT09IHgyICYmIHkxID09PSB5MikgewogICAgcmV0dXJuIDA7CiAgfQoKICBjb25zdCBtb3ZlcyA9IFsKICAgIFstMiwgLTFdLCBbLTEsIC0yXSwgWzEsIC0yXSwgWzIsIC0xXSwgCiAgICBbMiwgMV0sIFsxLCAyXSwgWy0xLCAyXSwgWy0yLCAxXQogIF07CgogIGNvbnN0IHF1ZXVlID0gW1t4MSwgeTEsIDBdXTsgCiAgY29uc3QgdmlzaXRlZCA9IG5ldyBTZXQoW2Ake3gxfSwke3kxfWBdKTsKCiAgd2hpbGUgKHF1ZXVlLmxlbmd0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