#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, m;
  cin >> a >> b;
  int n = a.length();
  for (int i = 0; i < n; ++i) m += min(a[i], b[i]);
  if (m == b) return cout << m, 0;
  cout << -1;
  return 0;
}
