#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
void solve() {
  long long n;
  long long m;
  cin >> n >> m;
  long long Min = n - (m * 2);
  if (Min < 0) Min = 0;
  long long Max;
  for (long long a = 2; a <= n; a++) {
    long long y = a * (a - 1) / 2;
    if (m <= y) {
      Max = n - a;
      break;
    }
  }
  if (m == 0) Max = n;
  cout << Min << ' ' << Max;
}
int main() {
  solve();
  cerr << endl << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << "s.\n";
  return 0;
}
