#include <bits/stdc++.h>
using namespace std;
int main() {
  int k = 0, flag = 0;
  char str[200], str1[200], str3[200], ch;
  scanf("%s", str);
  scanf("%s", str3);
  for (int i = 0; i < strlen(str); i++) {
    str1[k++] = min(str[i], str3[i]);
  }
  str1[k] = '\0';
  for (int i = 0; i < strlen(str); i++) {
    ch = min(str[i], str1[i]);
    if (ch != str3[i]) {
      flag = 1;
      break;
    }
  }
  if (flag == 1)
    cout << -1 << endl;
  else
    printf("%s\n", str1);
  return 0;
}
