#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  long long int v, e, ct = 0, cn = 0;
  cin >> v >> e;
  while ((ct < e) && (cn < v)) {
    cn++;
    ct += cn;
  }
  if (e == 0) {
    cn--;
  }
  cout << max((long long int)0, v - e * 2) << " "
       << max((long long int)0, v - cn - 1) << endl;
  return 0;
}
