#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long X = 0, w = 0;
  char ch = 0;
  while (!isdigit(ch)) {
    w |= ch == '-';
    ch = getchar();
  }
  while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
  return w ? -X : X;
}
inline void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
int main() {
  long long n = read(), m = read();
  if (m == 0) {
    write(n);
    cout << " ";
    write(n);
    return 0;
  }
  if (m == 1) {
    write(n - 2);
    cout << " ";
    write(n - 2);
    return 0;
  }
  if (n - m * 2 > 0) {
    write(n - m * 2);
    cout << " ";
  } else {
    write(0);
    cout << " ";
  }
  long long fl = -1;
  long long i;
  for (i = 2; i <= n; i++) {
    m -= (i - 1);
    if (m <= 0) break;
  }
  write(n - i);
  return 0;
}
