#include <bits/stdc++.h>
using namespace std;
const int MX = 1e6 + 10, MD = 1e9 + 7;
long long n, m, a[MX], ans, tmp;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (long long i = 1; i < 1000000; i++) {
    a[i] = (i * (i - 1)) / 2;
  }
  if (2 * m >= n) {
    cout << 0 << " ";
  } else {
    cout << n - 2 * m << " ";
  }
  for (int i = 0; i < 1000000; i++) {
    if (a[i] >= m) {
      cout << n - i;
      break;
    }
  }
}
