#include using namespace std; using ll = long long; int A, B; int main(void){ ios::sync_with_stdio(false); cin.tie(nullptr); cin >> A >> B; cout << 10 - A << " " << B - (10 - A) << endl; return 0; }