fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <iomanip>
  4. #include <bits/stdc++.h>
  5. #include <cstdio>
  6. #include <string>
  7. #define ll long long
  8. #define ST(a) a.first
  9. #define ND(a) a.second
  10. #define fin(a,n) for(int i = a; i < n; i++)
  11. #define fjn(a,n) for(int j = a; j < n; j++)
  12. #define all(a) a.begin(),a.end()
  13. #define FIFO ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
  14.  
  15. using namespace std;
  16.  
  17. void solve()
  18. {
  19. string s, t, ans = "";
  20. cin >> s >> t;
  21.  
  22. bool found = true;
  23. fin(0,s.size()){
  24. if(s[i] < t[i]){
  25. found = false; break;
  26. }
  27. }
  28.  
  29. if(!found){
  30. cout << "-1\n"; return;
  31. }
  32.  
  33. cout << t << '\n';
  34. }
  35. int main()
  36. {
  37. FIFO;
  38.  
  39. int tt = 1; //cin >> tt;
  40. while(tt--){
  41. solve();
  42. }
  43.  
  44. return 0;
  45. }
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout