#include <bits/stdc++.h>
int main() {
  char x[101], y[101];
  int i = 0;
  scanf("%s", x);
  scanf("%s", y);
  while (x[i]) {
    if (x[i] < y[i]) {
      break;
    }
    i++;
  }
  if (x[i] == 0) {
    printf("%s\n", y);
  } else {
    printf("-1\n");
  }
  return 0;
}
