using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); static long[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var a = NArr(2); var x = Math.Abs(a[0][0] * a[1][1] - a[0][1] * a[1][0]); var gcd = GCD(GCD(a[0][0], a[0][1]), GCD(a[1][0], a[1][1])); if (x == 0) WriteLine($"{gcd} 0"); else WriteLine($"{gcd} {x / gcd}"); } static long GCD(long a, long b) { if (a < 0) a = -a; if (b < 0) b = -b; if (a == 0) return b; if (b == 0) return a; if (a < b) return GCD(b, a); if (a % b == 0) return b; return GCD(b, a % b); } }