- Time limit: 1.00 s
- Memory limit: 512 MB
acab
are acab
, caba
, abac
, and baca
.Your task is to determine the lexicographically minimal rotation of a string.
Input
The only input line contains a string of length $n$. Each character is one of a–z.
Output
Print the lexicographically minimal rotation.
Constraints
- $1 \le n \le 10^6$
Input:
acab
Output:
abac