Advertisement
Saleh127

CF 946C

Jul 29th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define fellow_junior ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. int main()
  7. {
  8. fellow_junior
  9.  
  10. string a;
  11. ll c,d,i,j,k='a';
  12. cin>>a;
  13. if(a.size()<26)
  14. {
  15. cout<<-1<<endl;
  16. return 0;
  17. }
  18. for(i=0;i<a.size() && k<='z';i++)
  19. {
  20. if(a[i]<=k)
  21. {
  22. a[i]=k;
  23. k++;
  24. }
  25. }
  26. if(k>'z') cout<<a<<endl;
  27. else cout<<-1<<endl;
  28. return 0;
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement