#include <iostream>
#include <cmath>
using namespace std;
int main() {
char f1, f2;
int s1, s2, x, y;
cin >> f1>> s1;
cin >>f2 >> s2;
x = abs(f1 - f2);
y = abs(s1 - s2);
cout << min(x, y) << ' ' << max(x, y);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKIGNoYXIgZjEsIGYyOwogaW50IHMxLCBzMiwgeCwgeTsKIGNpbiA+PiBmMT4+IHMxOwogY2luID4+ZjIgPj4gczI7CiB4ID0gYWJzKGYxIC0gZjIpOwogeSA9IGFicyhzMSAtIHMyKTsKIGNvdXQgPDwgbWluKHgsIHkpIDw8ICcgJyA8PCBtYXgoeCwgeSk7CiByZXR1cm4gMDsKfQo=