#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &f) {
  f = 0;
  T fu = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') fu = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    f = (f << 3) + (f << 1) + (c & 15);
    c = getchar();
  }
  f *= fu;
}
template <typename T>
void print(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x < 10)
    putchar(x + 48);
  else
    print(x / 10), putchar(x % 10 + 48);
}
template <typename T>
void print(T x, char t) {
  print(x);
  putchar(t);
}
long long n, m;
int main() {
  read(n);
  read(m);
  cout << (max(0ll, n - m * 2)) << " ";
  if (m == 0) {
    cout << n << endl;
    return 0;
  }
  for (register int i = 1; i <= n; i++) {
    long long now = (long long)i * (i - 1) / 2;
    if (now >= m) {
      print(n - i, '\n');
      return 0;
    }
  }
  return 0;
}
