#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 9, M = 1e7, OO = 0x3f3f3f3f;
const long long int MOD = 1e9 + 7;
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  map<pair<char, char>, int> mp;
  for (int i = 0; i < int(s1.size()); ++i)
    if (s1[i] != s2[i]) {
      mp[{s1[i], s2[i]}]++;
    }
  for (int i = 0; i < int(s1.size()); ++i) {
    if (mp[{s2[i], s1[i]}] && mp[{s1[i], s2[i]}] || s2[i] > s1[i]) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 0; i < int(s1.size()); ++i) {
    if (s1[i] <= s2[i])
      cout << s1[i];
    else
      cout << s2[i];
  }
  return 0;
}
