func reverseString ( s [ ] byte ) {
l := 0
r := len ( s) - 1
for l < r {
s[ l] ^= s[ r]
s[ r] ^= s[ l]
s[ l] ^= s[ r]
l++
r--
}
}
func reverseStringRange ( s [ ] byte , l int , r int ) {
if r >= len ( s) {
r = len ( s) - 1
}
for l < r {
s[ l] ^= s[ r]
s[ r] ^= s[ l]
s[ l] ^= s[ r]
l++
r--
}
}
func reverseStr ( s string , k int ) string {
res := [ ] byte ( s)
count := 0
for i := 0 ; i < len ( s) ; i += 2 * k {
reverseStringRange ( res, i, i+ k- 1 )
count++
}
return string ( res)
}
def isNumber ( c) :
return c >= '0' and c <= '9'
s = input ( )
res = [ ]
for c in s:
res. append( "number" if isNumber( c) else c)
print ( "" . join( res) )
func reverseStringArr ( s [ ] string ) {
l := 0
r := len ( s) - 1
for l < r {
temp := s[ l]
s[ l] = s[ r]
s[ r] = temp
l++
r--
}
}
func reverseWords ( s string ) string {
chars := [ ] byte ( s)
temp := ""
var resArr [ ] string
for _ , char := range chars {
if char == ' ' {
if temp != "" {
resArr = append ( resArr, temp)
}
temp = ""
continue
}
temp = temp + string ( char)
}
if temp != "" {
resArr = append ( resArr, temp)
}
reverseStringArr ( resArr)
res := ""
for i, s := range resArr {
res += s
if i != len ( resArr) - 1 {
res += " "
}
}
return res
}
n = int ( input ( "" ) )
s = input ( "" )
print ( s[ - n: ] + s[ : - n] )
n = int ( input ( "" ) )
s = input ( "" )
r = len ( s) - 1
reverse( s, 0 , r- n)
reverse( s, r- n, r)
reverse( s, 0 , r)
print ( s[ - n: ] + s[ : - n] )