#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  if (m == 0)
    cout << n << " " << n << endl;
  else {
    long long int y = (n * n) - ((n * (n + 1)) / 2);
    if (m >= y) {
      cout << 0 << " " << 0 << endl;
    } else {
      long long int y1 = 0;
      if (m < n) y1 = n - (m * 2);
      if (y1 < 0) y1 = 0;
      long long int ans = 0;
      long long int o = 1;
      long long int u = 1;
      long long int k = 1;
      while (u < m) {
        o++;
        k++;
        u += o;
      }
      ans = n - (k + 1);
      cout << y1 << " " << ans << endl;
    }
  }
  return 0;
}
