#include <bits/stdc++.h>
using namespace std;
long long n, m, minn, maks, idx;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> m;
  minn = n - m * 2;
  if (minn < 0) minn = 0;
  for (long long i = 0; i <= 100005; i++) {
    if (i * (i - 1) / 2 <= m)
      idx = i;
    else
      break;
  }
  if (idx <= 1)
    idx = 0;
  else if (m > idx * (idx - 1) / 2)
    idx++;
  cout << minn << " " << n - idx << "\n";
}
