# a='どうしていするかな'
# printf("input = ")
a=gets.chomp
len=a.length
len.times{|i|
printf("%s",a[i..-1])
printf("%s",a[0..i-1]) if i>0
puts
}
puts
len=a.length
a=a.split(//).cycle
len.times{|i|
len.times{|j|
printf("%s",a.next)
}
a.next
puts
}
IyBhPSfjganjgYbjgZfjgabjgYTjgZnjgovjgYvjgaonCiMgcHJpbnRmKCJpbnB1dCA9ICIpCmE9Z2V0cy5jaG9tcAoKbGVuPWEubGVuZ3RoCmxlbi50aW1lc3t8aXwKCXByaW50ZigiJXMiLGFbaS4uLTFdKQoJcHJpbnRmKCIlcyIsYVswLi5pLTFdKSBpZiBpPjAKCXB1dHMKfQoKcHV0cwoKbGVuPWEubGVuZ3RoCmE9YS5zcGxpdCgvLykuY3ljbGUKbGVuLnRpbWVze3xpfAoJbGVuLnRpbWVze3xqfAoJCXByaW50ZigiJXMiLGEubmV4dCkKCX0KCWEubmV4dAoJcHV0cwp9Cg==