#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m;
  cin >> n >> m;
  if (m == 0) {
    cout << n << " " << n << endl;
    return 0;
  }
  long long ans = n;
  long long min = 0;
  for (int i = 0; i < n; i++) {
    min += i;
    ans--;
    if (min >= m) break;
  }
  cout << max(0ll, n - 2 * m) << " " << ans << endl;
  return 0;
}
