// Задача "Прямоугольный полигон"
// Шестая индивидуальная Интернет-олимпиада сезона 2009-2010.
// Автор задачи: Федор Царев, tsarev@rain.ifmo.ru
// Автор решения: Максим Носенко, nosenko@rain.ifmo.ru

import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class rect_mn implements Runnable {

	public static void main(String args[]) {
		new Thread(new rect_mn()).start();
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	private String FNAME = "rect";
	boolean eof = false;

	@Override
	public void run() {
		try {
			Locale.setDefault(Locale.US);
			br = new BufferedReader(new FileReader(FNAME + ".in"));
			out = new PrintWriter(FNAME + ".out");
			solve();
			br.close();
			out.close();

		} catch (Exception e) {
			e.printStackTrace();
			System.exit(566);
		}
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				eof = true;
				return "0";
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	long nextLong() {
		return Long.parseLong(nextToken());
	}

	double nextDouble() {
		return Double.parseDouble(nextToken());
	}

	void My_Assert(boolean b, String s) {
		if (!b)
			throw new Error("Assertion " + s);
	}

	final int maxS = (int) 5e8;
	final int maxP = 60000;

	private void solve() {
		int S = nextInt();
		int P = nextInt();
		My_Assert(1 <= S && S <= maxS, "S is out of range: " + S);
		My_Assert(1 <= P && P <= maxP, "P is out of range: " + P);
		My_Assert(P % 2 == 0, "P is not even: " + P);
		
		double p = P / 2.0;
		double q = S;
		double D = p * p - 4 * q;
		if (D < 0) {
			out.println(-1);
		} else {
			double x1 = (p + sqrt(D)) / 2;
			double x2 = (p - sqrt(D)) / 2;
			
			int a = (int)(x1);
			int b = (int)(x2);
			if (2 * (a + b) == P && a * b == S) {
				out.println(a + " " + b);
			} else {
				out.println(-1);
			}
		}
	}
}
