#include <bits/stdc++.h>
using namespace std;
long long powm(long long base, long long exp, long long mod = 1000000007) {
  long long ans = 1;
  while (exp) {
    if (exp & 1) ans = (ans * base) % mod;
    exp >>= 1, base = (base * base) % mod;
  }
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  long long min, max1;
  min = max(0LL, n - m * 2);
  for (long long i = 0; i <= n; i++)
    if (i * (i - 1) / 2 >= m) {
      max1 = n - i;
      break;
    }
  cout << min << " " << max1 << endl;
}
