#include <bits/stdc++.h>
using namespace std;
long long n, m;
long long ch[100000 + 5];
int main() {
  for (int i = 1; i <= 100000; i++) ch[i] = ch[i - 1] + i;
  cin >> n >> m;
  long long edges = m;
  long long nodes = n;
  if (m == 0) return cout << n << ' ' << n << endl, 0;
  while (edges--) nodes -= 2;
  cout << max(0LL, nodes) << ' ';
  edges = m;
  nodes = n;
  for (int i = 1; i <= 100000; i++) {
    if (ch[i - 1] >= m) {
      cout << n - i;
      break;
    }
  }
  return 0;
}
