#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  if (m == 0) {
    cout << n << " " << n;
    return 0;
  }
  long double p = pow(1 + 8 * m, 0.5);
  p -= 1;
  p = p / 2;
  long long int ans = ceil(p);
  ans += 1;
  long long int h = 0;
  cout << max(h, n - 2 * m) << " ";
  cout << n - ans;
}
