#include <bits/stdc++.h>
using namespace std;
long double PI = acosl(-1);
bool compare_int(int a, int b) { return (a > b); }
bool compare_string(string a, string b) { return a.size() < b.size(); }
bool compare_pair(const pair<int, int> &a, const pair<int, int> &b) {
  if (a.second == b.second)
    return a.first > b.first;
  else
    return (a.second > b.second);
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, m, x, ma;
  cin >> n >> m;
  if (m == 0) {
    cout << n << ' ' << n << endl;
    return 0;
  }
  long long int l = (n * (n - 1)) / 2;
  map<long long int, long long int> a;
  a[2] = 1;
  for (long long int i = 2; i <= n; i++) {
    a[i + 1] = a[i] + i;
  }
  long long int mi = n - (m * 2);
  for (long long int i = 2; i <= n; i++) {
    if (a[i] >= m) {
      ma = i;
      break;
    }
  }
  cout << max(0ll, mi) << ' ' << n - ma << endl;
}
