#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int min = 0, max = 0;
  if (a > b) {
    min = b;
    max = a;
  } else {
    min = a;
    max = b;
  }
  int c = (max + min) / 2;
  cout << c;
  cout << endl;
  int d = max - c;
  int sum = 0;
  for (int i = 1; i <= d; i++) {
    sum += i;
  }
  if ((max + min) % 2 == 0)
    cout << sum * 2;
  else
    cout << sum * 2 - d;
}
