#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n, m;
  long long mn, mx;
  cin >> n >> m;
  mn = n;
  mn = max(0ll, n - 2 * m);
  cout << mn << ' ';
  long long cnt = 0;
  while (m > 0) {
    m -= cnt;
    cnt++;
  }
  cout << max(0ll, n - cnt) << '\n';
}
