#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  long long mx = 0;
  if (m > 0) {
    while (mx * (mx - 1) / 2 < m) {
      mx++;
    }
  }
  cout << n - min(n, m * 2) << " " << n - mx << "\n";
  return 0;
}
