#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    long long int n, m;
    cin >> n >> m;
    long long int mi, ma;
    if (n == 1) {
      cout << "1 1";
      return 0;
    }
    mi = max((long long int)0, n - 2 * m);
    long long int c[100001] = {0};
    for (long long int i = 1; i < 100001; i++) c[i] = (i * (i - 1)) / 2;
    long long int p = lower_bound(c, c + 100001, m) - c;
    ma = n - p;
    cout << mi << " " << ma;
  }
}
