#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
void sync_stdio() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
}
struct Sync_stdio {
  Sync_stdio() {
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
  }
} _sync_stdio;
struct FAIL {
  FAIL() {
    cout << "CHANGE!!!"
         << "\n";
  }
};
int main() {
  string x, y;
  cin >> x >> y;
  string z = y;
  string t = y;
  for (int i = (0); i < (x.size()); ++i) {
    t[i] = min(x[i], z[i]);
  }
  if (z == t) {
    cout << z;
  } else {
    cout << -1;
  }
  return 0;
}
