#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int c, s;
int a, b1, b2, b, d;

int main(void) {
	scanf("%d %d", &c, &s);

	d = c - 4;
	b1 = (d + sqrt(d * d - 4 * 2 * 2 * s)) / 4;
	b2 = (d - sqrt(d * d - 4 * 2 * 2 * s)) / 4;

	if (b1 < b2) {
		b = b1 + 2;
		a = b2 + 2;
	} else {
		b = b2 + 2;
		a = b1 + 2;
	}

	printf("%d %d\n", a, b);

	return 0;
}
