#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  unsigned long long int n, m;
  cin >> n >> m;
  if (m == 0) {
    cout << n << " " << n;
    return 0;
  }
  unsigned long long int max, min;
  if (m >= n - 1) {
    max = 0;
  } else {
    max = n - m - 1;
  }
  unsigned long long int ctr = 1;
  unsigned long long int res;
  unsigned long long int i;
  for (i = 2; i <= n; i++) {
    res = (i * (i - 1)) / 2;
    if (res >= m) break;
  }
  if (max == (n * (n - 1)) / 2)
    max = 0;
  else
    max = n - i;
  if (m > n / 2) {
    min = 0;
  } else {
    min = n - 2 * m;
  }
  cout << min << " " << max;
  return 0;
}
