#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  if (m == 0) {
    cout << n << " " << n << endl;
    return 0;
  }
  long long min = 0;
  if (m * 2ll <= n) {
    min = n - m * 2;
  }
  long long e = 1;
  long long g = 2;
  long long max = 0;
  for (long long i = 2; i <= n; i++) {
    if (e >= m) {
      max = n - i;
      break;
    }
    e += g;
    g++;
  }
  cout << min << " " << max << endl;
  return 0;
}
