/**
 * This function takes two pairs as input and swaps their values by modifying the original pairs.
 *
 * @param pair1 The first pair to be swapped.
 * @param pair2 The second pair to be swapped.
 * @return A pair containing the values of pair1 and pair2 after swapping.
 *
 * Example:
 * swapPairs(Pair(1, 2), Pair("a", "b")) // Output: Pair("a", "b") to Pair(1, 2)
 */
fun swapPairs(pair1: Pair<Any, Any>, pair2: Pair<Any, Any>): Pair<Any, Any> {

    // Swap values using destructuring declaration
    val (a, b) = pair1
    val (c, d) = pair2
    return Pair(c, d) to Pair(a, b)
}
/**
 * This function takes two pairs as input and swaps their values by modifying the original pairs.
 *
 * @param pair1 The first pair to be swapped.
 * @param pair2 The second pair to be swapped.
 * @return A pair containing the values of pair1 and pair2 after swapping.
 *
 * Example:
 * swapPairs(Pair(1, 2), Pair("a", "b")) // Output: Pair("a", "b") to Pair(1, 2)
 */
fun swapPairs(pair1: Pair<Any, Any>, pair2: Pair<Any, Any>): Pair<Any, Any> {
/**
 * This function takes two pairs as input and swaps their values by modifying the original pairs.
 *
 * @param pair1 The first pair to be swapped.
 * @param pair2 The second pair to be swapped.
 * @return A pair containing the values of pair1 and pair2 after swapping.
 *
 * Example:
 * swapPairs(Pair(1, 2), Pair("a", "b")) // Output: Pair("a", "b") to Pair(1, 2)
 */
fun swapPairs(pair1: Pair<Any, Any>, pair2: Pair<Any, Any>): Pair<Any, Any> {

    // Swap values using destructuring declaration
    val (a, b) = pair1
    val (c, d) = pair2
    return Pair(c, d) to Pair(a, b)
}