#include <bits/stdc++.h>
using namespace std;
long long n, m;
int main() {
  ios_base::sync_with_stdio(1);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n >> m;
  if (m == 0) {
    cout << n << ' ' << n;
    return 0;
  }
  long long i = 1;
  for (i; i <= n; i++)
    if ((long long)i * (i - 1) / 2 >= (long long)m) break;
  cout << max((long long)0, n - m * 2) << ' ' << n - i;
}
