#include <bits/stdc++.h>
using namespace std;
int n;
long long m;
int main() {
  scanf("%d%I64d", &n, &m);
  if (n >= m) {
    if (m == 0)
      printf("%d %d\n", n, n);
    else {
      printf("%d ", max(0, n - (int)m * 2));
      long long ans = 0;
      for (int i = 1; i <= n; i++) {
        ans += (long long)i;
        if (ans >= m) {
          ans = i;
          break;
        }
      }
      printf("%I64d\n", n - ans - 1);
    }
  } else {
    printf("0 ");
    long long ans = 0;
    for (int i = 2; i <= n; i++) {
      ans += (long long)i - 1;
      if (ans >= m) {
        ans = i;
        break;
      }
    }
    printf("%I64d\n", n - ans);
  }
  return 0;
}
