#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0;
  char c = getchar();
  while (c <= 32) c = getchar();
  while (c > 32) x = 10 * x + c - '0', c = getchar();
  return x;
}
int main() {
  long long n, k;
  cin >> n >> k;
  cout << max(n - 2 * k, 1LL * 0) << " ";
  if (k == 0) {
    cout << n;
    return 0;
  }
  for (long long i = 1; i <= n; i++)
    if ((1LL * i * (i - 1) / 2) >= k) {
      printf("%d", n - i);
      break;
    }
  return 0;
}
