// https://koosaga.com/301
vi duval(vi &s){
    int n=s.size(), i=0; vi v;
    while(i<n) { int j=i+1, k=i;
        while(j < n && s[k] <= s[j]){
            if(s[k] == s[j]) j++, k++;
            else if(s[k] < s[j]) j++, k = i;
        }
        while(i <= k) i += j - k, v.pb(i);
    }
    return v;
}