#include <bits/stdc++.h>
using namespace std;
long long f(long long x) { return x * (x - 1) / 2; }
int main() {
  long long x, y, z = 0;
  cin >> x >> y;
  cout << max((long long)0, x - (2 * y)) << " ";
  while (f(z) < y) {
    z++;
  }
  cout << max((long long)0, x - z);
}
