#include <bits/stdc++.h>
using namespace std;
int a, b;
void init() {
  freopen("A.inp", "r", stdin);
  freopen("A.out", "w", stdout);
}
int main() {
  cin >> a >> b;
  int mi = (a + b) / 2;
  int d1 = abs(mi - a), d2 = abs(mi - b);
  cout << mi << endl;
  cout << (d2 * (d2 + 1) / 2 + (d1 * (d1 + 1)) / 2);
}
