#include <bits/stdc++.h>

#define ll long long int
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define phi 3.1415926535
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
using namespace std;

const ll mod = 1000000007;    

ll tc, cnt = 0, number, many, total = 0, query, require, length;
int rmove[8] = {1, 0, 0, -1, -1, 1, -1, 1};
int cmove[8] = {0, -1, 1, 0, 1, -1, -1, 1};

ll modpow(ll x, ll y, ll m)
{
    ll res = 1;
    while(y > 0)
    {
        if(y & 1)
            res = (res * x) % m;
        x = (x * x) % m;
        y >>= 1;
    }

    return res;
}

int main()
{
    fastio();
        
    // freopen("input.txt","r", stdin);
    // freopen("output.txt","w", stdout);
    // g++ -std=c++11 Default.cpp  -o test
    // g++ -Wl,--stack=268435456 -std=c++11 Default.cpp  -o test

    int a, b;
    cin >> a >> b;

    int temp = (a + b) / 2;
    cout << temp << " " << a - temp << '\n';

    //
    return 0;
}
#include <bits/stdc++.h>
#define N 10005
const int mmax = 1e9;
using namespace std;
int a, b;
void process()
{
    cin >> a >> b;
    int x = (a-b)/2;
    int y = (a+b)/2;
    if (x-y == b) cout << x <<" "<<y;
    else cout << y <<" "<< x;
}
int main()
{
    //freopen("test.INP", "r", stdin);
    process();
    return 0;
}
