#[allow(unused_imports)] use std::{ collections::{HashMap, HashSet, BinaryHeap, VecDeque, BTreeSet, BTreeMap}, io::{read_to_string, stdin, Write, stdout}, }; use proconio::{input, fastout, marker::Chars}; pub fn modulo(x: i64, y: i64)->i64{ (x%y+y)%y } pub fn gcd(a: i64, b: i64)->i64{ if b==0{ a } else { gcd(b, modulo(a, b)) } } //#[fastout] fn main(){ input!{ mut a: [i64; 4], } let mut g = 0; let mut pro = 1; for &v in &a{ g = gcd(g, v); pro *= v; } println!("{} {}", g, (a[0]*a[3]-a[1]*a[2]).abs()/g); }