#include <bits/stdc++.h>
using namespace std;
std::mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
constexpr int MAXN = 1e9 + 7;
constexpr int INF = 0x3f3f3f3f;
constexpr long long INFLL = 0x3f3f3f3f3f3f3f3f;
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.tie(nullptr);
  int a, b;
  cin >> a >> b;
  if (a == b) {
    cout << a << " " << 0 << "\n";
  } else {
    int ans = min(a, b);
    a -= ans;
    b -= ans;
    int left = max(a, b);
    int ans2 = left / 2;
    cout << ans << " " << ans2 << "\n";
  }
}
