/**
 * This function takes three lists as arguments and returns a new list
 * containing common elements found in all three lists.
 *
 * @param list1 list containing elements
 * @param list2 list containing elements
 * @param list3 list containing elements
 * @return list containing common elements
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>, list3: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    for (element1 in list1) {
        for (element2 in list2) {
            for (element3 in list3) {
                if (element1 == element2 && element2 == element3) {  // checks if element is common
                    commonElements.add(element1)  // appends common element to the list
                }
            }
        }
    }

    return commonElements
}
/**
 * This function takes three lists as arguments and returns a new list
 * containing common elements found in all three lists.
 *
 * @param list1 list containing elements
 * @param list2 list containing elements
 * @param list3 list containing elements
 * @return list containing common elements
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>, list3: List<Any>): List<Any> {
/**
 * This function takes three lists as arguments and returns a new list
 * containing common elements found in all three lists.
 *
 * @param list1 list containing elements
 * @param list2 list containing elements
 * @param list3 list containing elements
 * @return list containing common elements
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>, list3: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    for (element1 in list1) {
        for (element2 in list2) {
            for (element3 in list3) {
                if (element1 == element2 && element2 == element3) {  // checks if element is common
                    commonElements.add(element1)  // appends common element to the list
                }
            }
        }
    }

    return commonElements
}