#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  int x;
  long long max;
  long long int l = 2, h = n;
  while (l <= h) {
    long long int mid = (l + h) / 2;
    long long x = (mid * (mid - 1)) / 2;
    if (x > m)
      h = mid - 1;
    else if (x == m) {
      l = mid;
      break;
    } else
      l = mid + 1;
  }
  max = n - l;
  if (m <= 2) max = n - m - 1;
  long long min = (n - m * 2 > 0) ? n - 2 * m : 0;
  if (m == 0) max = n, min = n;
  cout << min << " " << max << endl;
  return 0;
}
