#include <bits/stdc++.h>
using namespace std;
long long N, M;
long long a, b;
long long cnt[100005];
int main() {
  scanf("%lld %lld", &N, &M);
  a = max(0LL, N - 2 * M);
  for (long long i = 0; i <= N; i++) {
    cnt[i] = i * (i - 1) / 2;
    if (cnt[i] >= M) {
      b = N - i;
      break;
    }
  }
  printf("%lld %lld", a, b);
}
