#include <bits/stdc++.h>
using namespace std;
const int cap = 1e5 + 10;
int main() {
  long long a[cap];
  a[1] = 0;
  long long n, m;
  long long Max, Min;
  cin >> n >> m;
  if (m == 0)
    Max = n;
  else {
    for (int i = 2; i <= n; i++) {
      a[i] = a[i - 1] + i - 1;
      if (a[i] >= m) {
        Max = n - i;
        break;
      }
    }
  }
  Min = n - m * 2;
  if (Min < 0) Min = 0;
  cout << Min << " " << Max << endl;
  return 0;
}
