/**
 * Given two strings s1 and s2, the function performs nested loops n times and shifts characters in each iteration.
 *
 * @param s1 String containing alphanumeric characters.
 * @param s2 String containing alphanumeric characters.
 * @param n Integer specifying the number of iterations.
 */
fun nestedLoopShiftOperators(s1: String, s2: String, n: Int) {

    // Concatenate s1 and s2
    var combined = s1 + s2

    // Calculate length of combined string
    val length = combined.length

    // Perform nested loops n times
    repeat(n) {
        // Execute left shift operation
        combined = combined.substring(1) + combined[0]

        // Execute right shift operation
        combined = combined.last() + combined.substring(0, combined.length - 1)

        // Print the shifted string
        for (j in 0 until length) {
            println("${combined[j % length]} ${j % length + 1}")
        }
        println()
    }
}
/**
 * Given two strings s1 and s2, the function performs nested loops n times and shifts characters in each iteration.
 *
 * @param s1 String containing alphanumeric characters.
 * @param s2 String containing alphanumeric characters.
 * @param n Integer specifying the number of iterations.
 */
fun nestedLoopShiftOperators(s1: String, s2: String, n: Int) {
/**
 * Given two strings s1 and s2, the function performs nested loops n times and shifts characters in each iteration.
 *
 * @param s1 String containing alphanumeric characters.
 * @param s2 String containing alphanumeric characters.
 * @param n Integer specifying the number of iterations.
 */
fun nestedLoopShiftOperators(s1: String, s2: String, n: Int) {

    // Concatenate s1 and s2
    var combined = s1 + s2

    // Calculate length of combined string
    val length = combined.length

    // Perform nested loops n times
    repeat(n) {
        // Execute left shift operation
        combined = combined.substring(1) + combined[0]

        // Execute right shift operation
        combined = combined.last() + combined.substring(0, combined.length - 1)

        // Print the shifted string
        for (j in 0 until length) {
            println("${combined[j % length]} ${j % length + 1}")
        }
        println()
    }
}