#include <bits/stdc++.h>
using namespace std;
inline long long gcd(long long a, long long b) {
  if (a % b)
    return gcd(b, a % b);
  else
    return b;
}
long long n, m, x, y;
int main() {
  scanf("%I64d %I64d", &n, &m);
  if (2 * m >= n) {
    x = 0;
  } else
    x = n - 2 * m;
  long long pos = 2;
  while ((pos * (pos - 1)) < 2 * m) pos++;
  y = n - pos;
  if (y < 0) y = n;
  if (m == 0) x = y = n;
  printf("%I64d %I64d\n", x, y);
  return 0;
}
