#include <bits/stdc++.h>
using namespace std;
const int N = int(2e5) + 5;
const int inf = (int)1e9 + 7;
int main() {
  int n;
  long long m;
  scanf("%d %lld", &n, &m);
  if (n == 1) {
    printf("1 1");
    return 0;
  }
  printf("%d ", max(0ll, n - 2 * m));
  for (int i = 0; i <= n; ++i) {
    long long p = (!i ? 0 : i * 1ll * (i - 1) / 2);
    if (p >= m) {
      printf("%d", n - i);
      return 0;
    }
  }
  printf("%d", 0);
  return 0;
}
