#include <bits/stdc++.h>
using namespace std;
void init() {
  freopen("cf.inp", "r", stdin);
  freopen("cf.out", "w", stdout);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  long long m;
  cin >> n >> m;
  if (m == 0) {
    cout << n << ' ' << n << endl;
    return 0;
  }
  cout << max(n - m * 2, (long long)(0)) << ' ';
  long long tmp = 1;
  while (m > 0) {
    m -= tmp;
    n--;
    tmp++;
  }
  cout << n - 1 << endl;
}
