#include <bits/stdc++.h>
using namespace std;
long long n, m, k, p, ans1, ans2;
int main() {
  cin >> n >> m;
  if (n - 2 * m > 0)
    ans1 = n - 2 * m;
  else
    ans1 = 0;
  k = 0;
  p = 0;
  while (k < m) {
    p++;
    k += p;
    k--;
  }
  ans2 = n - p;
  cout << ans1 << " " << ans2;
  return 0;
}
