#include<bits/stdc++.h>
using namespace std;

#define ll              long long
#define deb(x)          cout << #x << "=" << x << endl
#define deb2(x, y)      cout << #x << "=" << x << " , " << #y << "=" << y << endl

typedef pair<int, int>ii;
typedef pair<ll, ll>pl;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<ii>vii;
typedef vector<pl>vll;
typedef vector<vi>vvi;
typedef vector<vl>vvl;

const int mod = 1000000007;
const int N = 1e5+5, M = N;


void solve()
{
    ll n, m;
    scanf("%lld %lld",&n ,&m);

    printf("%lld %lld\n",(n+m)/2 , (n-m)/2);
}


int main()
{
    int t = 1;
    
    //scanf("%d",&t);

    while(t--)
    {
        solve();
    }

    return 0;
}


#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;
using ll = int64_t;
#define rep(i, j, n) for (int i = j; i < (n); ++i)
#define rrep(i, j, n) for (int i = (n)-1; j <= i; --i)

template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T>& a) {
  os << "{";
  for (size_t i = 0; i < a.size(); ++i) os << (i > 0 ? "," : "") << a[i];
  return os << "}";
}
[[maybe_unused]] constexpr ll MOD = 998244353;
[[maybe_unused]] constexpr int INF = 0x3f3f3f3f;
[[maybe_unused]] constexpr ll INFL = 0x3f3f3f3f3f3f3f3fLL;

int main() {
  ll a, b;
  cin >> a >> b;

  // x + y = a, x - y = b
  // x * 2 = a + b
  // y * 2 = a - b
  cout << (a + b) / 2 << " " << (a - b) / 2 << endl;

  return 0;
}