#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  std::cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  std::cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, m;
  cin >> n >> m;
  long long int min = m * 2;
  if (min >= n) {
    min = 0;
  } else {
    min = n - min;
  }
  long long int dp[n + 1];
  dp[0] = 0;
  long long int ind = -1;
  for (long long int i = 0; i <= n; i++) {
    if (i == 0) {
      dp[i] = 0;
    } else {
      dp[i] = dp[i - 1] + i - 1;
    }
    if (dp[i] >= m) {
      ind = i;
      break;
    }
  }
  long long int max;
  if (ind == -1) {
    max = 0;
  } else {
    max = n - ind;
  }
  cout << min << " " << max;
  return 0;
}
