#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef vector VI; typedef pair PSS; #define REP(i,s,t) for(int i=(s);i<(t);i++) #define FILL(x,v) memset(x,v,sizeof(x)) PSS read() { string s, a, b; cin >> s; REP(i,0,s.size()) { if (s[i] == '.') { a = s.substr(0, i); b = s.substr(i + 1); break; } } return PSS(a, b); } void print(PSS &v) { cout << v.first << "." << v.second << endl; } PSS normalize(string a, string b) { while (a.size() < b.size()) a += "0"; while (b.size() < a.size()) b += "0"; return PSS(a, b); } int main() { PSS x = read(); PSS y = read(); if (x.first != y.first) print(stoi(x.first) > stoi(y.first) ? x : y); else { PSS norm = normalize(x.second, y.second); if (((norm.first > norm.second) ^ (stoi(x.second) > stoi(y.second))) || stoi(x.second) == stoi(y.second)) cout << -1 << endl; else { print(norm.first > norm.second ? x : y); } } return 0; }