/**
 * This function takes three sets as inputs and returns a list containing all the common elements among them.
 *
 * @param set1 A set of elements.
 * @param set2 A set of elements.
 * @param set3 A set of elements.
 * @return A list containing the common elements among all three sets.
 *
 * Example:
 * findCommonElements(setOf(1, 2, 3, 4), setOf(2, 4, 6, 8), setOf(3, 4, 5, 6)) // [4]
 * findCommonElements(setOf('a', 'b', 'c'), setOf('b', 'd', 'e'), setOf('c', 'e', 'f')) // ['c']
 * findCommonElements(setOf(1, 2), setOf(3, 4), setOf(5, 6)) // []
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>, set3: Set<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()
    for (elem1 in set1) {
        for (elem2 in set2) {
            for (elem3 in set3) {
                if (elem1 == elem2 && elem2 == elem3) {
                    commonElements.add(elem1)
                }
            }
        }
    }
    return commonElements
}
/**
 * This function takes three sets as inputs and returns a list containing all the common elements among them.
 *
 * @param set1 A set of elements.
 * @param set2 A set of elements.
 * @param set3 A set of elements.
 * @return A list containing the common elements among all three sets.
 *
 * Example:
 * findCommonElements(setOf(1, 2, 3, 4), setOf(2, 4, 6, 8), setOf(3, 4, 5, 6)) // [4]
 * findCommonElements(setOf('a', 'b', 'c'), setOf('b', 'd', 'e'), setOf('c', 'e', 'f')) // ['c']
 * findCommonElements(setOf(1, 2), setOf(3, 4), setOf(5, 6)) // []
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>, set3: Set<Any>): List<Any> {
/**
 * This function takes three sets as inputs and returns a list containing all the common elements among them.
 *
 * @param set1 A set of elements.
 * @param set2 A set of elements.
 * @param set3 A set of elements.
 * @return A list containing the common elements among all three sets.
 *
 * Example:
 * findCommonElements(setOf(1, 2, 3, 4), setOf(2, 4, 6, 8), setOf(3, 4, 5, 6)) // [4]
 * findCommonElements(setOf('a', 'b', 'c'), setOf('b', 'd', 'e'), setOf('c', 'e', 'f')) // ['c']
 * findCommonElements(setOf(1, 2), setOf(3, 4), setOf(5, 6)) // []
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>, set3: Set<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()
    for (elem1 in set1) {
        for (elem2 in set2) {
            for (elem3 in set3) {
                if (elem1 == elem2 && elem2 == elem3) {
                    commonElements.add(elem1)
                }
            }
        }
    }
    return commonElements
}