#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int i, j, ans = 0, c = 1, n1, n2, a[300005], h[26];
  string s;
  for (i = 0; i < 26; i++) {
    h[i] = i;
  }
  char s1[200], s2[300], s3[300];
  cin >> s1 >> s2;
  n1 = strlen(s1);
  n2 = strlen(s2);
  if (n1 == n2) {
    for (i = 0; i < n1; i++) {
      if (h[s1[i] - 'a'] > h[s2[i] - 'a']) {
        s3[i] = s2[i];
      } else if (h[s1[i] - 'a'] < h[s2[i] - 'a']) {
        cout << "-1" << endl;
        return 0;
      } else {
        s3[i] = s2[i];
      }
    }
  } else {
    cout << "-1";
    return 0;
  }
  for (i = 0; i < n1; i++) {
    cout << s3[i];
  }
  return 0;
}
