#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cctype>
using namespace std;
typedef long long ll;
int N;
struct Fra{
ll up, down;
}sum, temp;
ll gcd(ll a, ll b){
return b == 0 ? a : gcd(b, a%b);
}
Fra reduction(Fra f){
ll d = gcd(f.up, f.down);
f.up /= d; f.down /= d;
if(f.down < 0){
f.up = -f.up; f.down = -f.down;
}
if(f.up == 0) f.down = 1;
return f;
}
Fra add(Fra f1, Fra f2){
Fra sum;
sum.up = f1.up * f2.down + f2.up * f1.down;
sum.down = f1.down * f2.down;
return reduction(sum);
}
void printAns(Fra f){
if(f.up < 0){
putchar('-');
f.up = -f.up;
}
if(f.down == 1) printf("%lld\n", f.up);
else if(f.up > f.down){
printf("%lld %lld/%lld\n", f.up/f.down, f.up%f.down, f.down);
}else printf("%lld/%lld\n", f.up%f.down, f.down);
}
int main(){
sum.up = 0, sum.down = 1;
scanf("%d", &N);
for(int i = 0; i < N; i++){
scanf("%lld/%lld", &temp.up, &temp.down);
sum = add(sum, temp);
}
printAns(sum);
return 0;
}