#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  long long int min = n - (2 * m);
  if (min < 0) min = 0;
  long long int max, x = 1;
  while (true) {
    if (x * (x - 1) == 2 * m) {
      break;
    } else if (x * (x - 1) > 2 * m) {
      break;
    }
    x++;
  }
  if (m != 0)
    cout << min << " " << n - x << "\n";
  else
    cout << min << " " << n << "\n";
  return 0;
}
