#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
void dv(vector<int> v) {
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
}
bool check_prime(int a) {
  for (int i = sqrt(a); i > 1; i--) {
    if (a % i == 0) return false;
  }
  return true;
}
int ctoil(char c) { return (int)c - 97; }
int ctoiu(char c) { return (int)c - 65; }
void dv_2d(vector<vector<int>> v) {
  for (int i = 0; i < v.size(); i++) {
    for (int j = 0; j < v[i].size(); j++) {
      cout << v[i][j] << " ";
    }
    cout << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m;
  cin >> n >> m;
  long long a, b;
  if (n <= 2 * m) {
    a = 0;
  } else {
    a = n - 2 * m;
  }
  if (m == 0) {
    b = n;
  } else {
    b = n - ceil((sqrt(1 + 8 * m) + 1) / 2);
  }
  cout << a << " " << b << endl;
}
