import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Fraction one = new Fraction(scanner.nextLine()), two = new Fraction(scanner.nextLine());
Fraction result = mulFraction(one, two);
System.out.println(result.month + " " + result.son);
}
static Fraction mulFraction(Fraction one, Fraction two) {
int mulSon = one.son * two.son, mulMonth = one.month * two.month;
while (mulSon % 2 == 0 && mulMonth % 2 == 0) {
mulSon /= 2;
mulMonth /= 2;
}
if (mulMonth % mulSon == 0) {
int cache = mulSon;
mulSon = 1;
mulMonth /= cache;
}
return new Fraction(mulSon, mulMonth);
}
}
class Fraction {
int son, month;
public Fraction(int son, int month) {
this.son = son;
this.month = month;
}
public Fraction(String fraction) {
String[] two = fraction.split("/");
String son = two[0], month = two[1];
this.son = Integer.parseInt(son);
this.month = Integer.parseInt(month);
}
@Override
public String toString() {
return month + "/" + son;
}
}