#include <bits/stdc++.h>
using namespace std;
const int N = 1100;
const int MAXN = int(1e6) + 100;
const long long mod = int(1e9) + 7;
int solution();
int main(int argc, char* const argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  return solution();
}
long long n, m;
int solution() {
  cin >> n >> m;
  if (n == 1) return cout << "1 1", 0;
  if (m == 0) return cout << n << ' ' << n, 0;
  cout << max(0ll, n - 2 * m);
  cout << ' ';
  long long cnt = 1, ans = 0;
  while (ans < m && cnt < n) {
    ans += cnt;
    cnt++;
  }
  cout << n - cnt;
  cout << endl;
  return 0;
}
