#include <bits/stdc++.h>
using namespace std;
namespace fastio {
template <class T>
istream &operator>>(istream &os, vector<T> &vec) {
  for (auto &u : vec) os >> u;
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  for (auto &u : vec) os << u << " ";
  return os;
}
template <class T1, class T2>
inline istream &operator>>(istream &os, pair<T1, T2> &p) {
  return os >> p.first >> p.second;
}
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  return os << p.first << " " << p.second;
}
template <class T>
ostream &operator<<(ostream &os, set<T> &con) {
  for (auto &u : con) os << u << " ";
  return os;
}
void re() {}
template <typename T, typename... args>
void re(T &x, args &...tail) {
  cin >> x;
  re(tail...);
}
void pr() {}
template <typename T>
void pr(const T &x) {
  cout << x;
}
template <typename T, typename... args>
void pr(const T &x, const args &...tail) {
  cout << x << " ";
  pr(tail...);
}
template <typename... args>
void prln(const args &...tail) {
  pr(tail...);
  cout << "\n";
}
}  // namespace fastio
using namespace fastio;
const long long int mod = 1e9 + 7;
const long long int mod1 = 998244353;
void fs(long long int &number) {
  bool negative = false;
  register int c;
  number = 0;
  c = getchar();
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;
  if (negative) number *= -1;
}
bool isprime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
bool checkisTree(long long int degree[], long long int n) {
  long long int deg_sum = 0;
  for (long long int i = 0; i < n; i++) deg_sum += degree[i];
  return (2 * (n - 1) == deg_sum);
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int findS(long long int s) { return (sqrt(8 * s + 1) - 1) / 2; }
long long int LOGN(long long int n, long long int r) {
  return (n > r - 1) ? (1 + LOGN(n / r, r)) : 0;
}
bool check(long long int a) {
  long long int arr[10];
  memset(arr, 0, sizeof(arr));
  while (a) {
    long long int x = a % 10;
    arr[x]++;
    a = a / 10;
  }
  for (long long int i = 0; i <= 9; i++) {
    if (arr[i] > 1) return false;
  }
  return true;
}
int main() {
  cin.sync_with_stdio(0);
  cin.exceptions(cin.failbit);
  cin.tie(0);
  long long int t = 1;
  while (t--) {
    long long int n, m;
    re(n, m);
    for (long long int i = n; i <= m; i++) {
      if (check(i)) {
        prln(i);
        return 0;
      }
    }
    prln("-1");
  }
}

### Prompt

Develop a solution in Cpp to the problem described below:

You have two integers l and r. Find an integer x which satisfies the conditions below:

  * l ≤ x ≤ r. 
  * All digits of x are different. 



If there are multiple answers, print any of them.

Input

The first line contains two integers l and r (1 ≤ l ≤ r ≤ 10^{5}).

Output

If an answer exists, print any of them. Otherwise, print -1.

Examples

Input


121 130


Output


123


Input


98766 100000


Output


-1

Note

In the first example, 123 is one of the possible answers. However, 121 can't be the answer, because there are multiple 1s on different digits.

In the second example, there is no valid answer.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
namespace fastio {
template <class T>
istream &operator>>(istream &os, vector<T> &vec) {
  for (auto &u : vec) os >> u;
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  for (auto &u : vec) os << u << " ";
  return os;
}
template <class T1, class T2>
inline istream &operator>>(istream &os, pair<T1, T2> &p) {
  return os >> p.first >> p.second;
}
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  return os << p.first << " " << p.second;
}
template <class T>
ostream &operator<<(ostream &os, set<T> &con) {
  for (auto &u : con) os << u << " ";
  return os;
}
void re() {}
template <typename T, typename... args>
void re(T &x, args &...tail) {
  cin >> x;
  re(tail...);
}
void pr() {}
template <typename T>
void pr(const T &x) {
  cout << x;
}
template <typename T, typename... args>
void pr(const T &x, const args &...tail) {
  cout << x << " ";
  pr(tail...);
}
template <typename... args>
void prln(const args &...tail) {
  pr(tail...);
  cout << "\n";
}
}  // namespace fastio
using namespace fastio;
const long long int mod = 1e9 + 7;
const long long int mod1 = 998244353;
void fs(long long int &number) {
  bool negative = false;
  register int c;
  number = 0;
  c = getchar();
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;
  if (negative) number *= -1;
}
bool isprime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
bool checkisTree(long long int degree[], long long int n) {
  long long int deg_sum = 0;
  for (long long int i = 0; i < n; i++) deg_sum += degree[i];
  return (2 * (n - 1) == deg_sum);
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int findS(long long int s) { return (sqrt(8 * s + 1) - 1) / 2; }
long long int LOGN(long long int n, long long int r) {
  return (n > r - 1) ? (1 + LOGN(n / r, r)) : 0;
}
bool check(long long int a) {
  long long int arr[10];
  memset(arr, 0, sizeof(arr));
  while (a) {
    long long int x = a % 10;
    arr[x]++;
    a = a / 10;
  }
  for (long long int i = 0; i <= 9; i++) {
    if (arr[i] > 1) return false;
  }
  return true;
}
int main() {
  cin.sync_with_stdio(0);
  cin.exceptions(cin.failbit);
  cin.tie(0);
  long long int t = 1;
  while (t--) {
    long long int n, m;
    re(n, m);
    for (long long int i = n; i <= m; i++) {
      if (check(i)) {
        prln(i);
        return 0;
      }
    }
    prln("-1");
  }
}

```