#include <bits/stdc++.h>
using namespace std;
long long npo2(int k) { return 1LL * k * (k - 1) / 2; }
int main() {
  int n;
  long long m;
  scanf("%d%lld", &n, &m);
  int k = 0;
  while (npo2(k) < m) k++;
  printf("%lld %d\n", max(0ll, n - m * 2), n - k);
  return 0;
}
