#include <bits/stdc++.h>
using namespace std;
#define ms(s,n) memset(s,n,sizeof(s))
#define all(a) a.begin(),a.end()
#define present(t, x) (t.find(x) != t.end())
#define sz(a) int((a).size())
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i)
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define mp make_pair
#define endl "\n"
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9+7;
const int INF = (int) 1e9+2804;
inline ll gcd(ll a,ll b){ll r;while(b){r=a%b;a=b;b=r;}return a;}
inline ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
class PhanSo{
private:
ll tu, mau;
public:
PhanSo(){
}
PhanSo(ll a, ll b){
this->tu = a;
this->mau = b;
}
friend PhanSo operator + (const PhanSo a, const PhanSo b){
ll mc = lcm(a.mau, b.mau);
PhanSo tong;
tong.tu = mc / a.mau * a.tu + mc / b.mau * b.tu;
tong.mau = mc;
ll g = gcd(tong.tu, tong.mau);
tong.tu /= g;
tong.mau /= g;
return tong;
}
friend ostream& operator << (ostream& out, const PhanSo a){
out << a.tu << "/" << a.mau << endl;
return out;
}
friend istream& operator >> (istream& in, PhanSo& a){
in >> a.tu >> a.mau;
return in;
}
};
int main() {
PhanSo p(1,1), q(1,1);
cin >> p >> q;
cout << p + q;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIG1zKHMsbikgbWVtc2V0KHMsbixzaXplb2YocykpCiNkZWZpbmUgYWxsKGEpIGEuYmVnaW4oKSxhLmVuZCgpCiNkZWZpbmUgcHJlc2VudCh0LCB4KSAodC5maW5kKHgpICE9IHQuZW5kKCkpCiNkZWZpbmUgc3ooYSkgaW50KChhKS5zaXplKCkpCiNkZWZpbmUgRk9SKGksIGEsIGIpIGZvciAoa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