#include #include using namespace std; int main() { int a, b; cin >> a >> b; a = 10 - a; b = b - a; cout << a; cout << " "; cout << b << endl; }