#include using namespace std; int A, B; int main() { cin >> A >> B; cout << 10 - A << " " << B - (10 - A) << endl; return 0; }