/**
 * Compares two lists of customers based on their age, location, and purchase history.
 *
 * @param customers1 List of tuples representing customers 1 with each tuple containing age, location, and purchase history.
 * @param customers2 List of tuples representing customers 2 with each tuple containing age, location, and purchase history.
 * @return List of customers satisfying the given conditions.
 */
fun compareCustomers(customers1: List<Triple<Int, String, String>>, customers2: List<Triple<Int, String, String>>): List<Triple<Int, String, String>> {

    val result = mutableListOf<Triple<Int, String, String>>()

    for (customer1 in customers1) {
        for (customer2 in customers2) {
            if (customer1.first > customer2.first ||
                (customer1.second == customer2.second && customer1.third != customer2.third) ||
                (customer1.second != customer2.second && customer1.third == customer2.third)
            ) {
                result.add(customer1)
                break
            }
        }
    }

    return result
}
/**
 * Compares two lists of customers based on their age, location, and purchase history.
 *
 * @param customers1 List of tuples representing customers 1 with each tuple containing age, location, and purchase history.
 * @param customers2 List of tuples representing customers 2 with each tuple containing age, location, and purchase history.
 * @return List of customers satisfying the given conditions.
 */
fun compareCustomers(customers1: List<Triple<Int, String, String>>, customers2: List<Triple<Int, String, String>>): List<Triple<Int, String, String>> {
/**
 * Compares two lists of customers based on their age, location, and purchase history.
 *
 * @param customers1 List of tuples representing customers 1 with each tuple containing age, location, and purchase history.
 * @param customers2 List of tuples representing customers 2 with each tuple containing age, location, and purchase history.
 * @return List of customers satisfying the given conditions.
 */
fun compareCustomers(customers1: List<Triple<Int, String, String>>, customers2: List<Triple<Int, String, String>>): List<Triple<Int, String, String>> {

    val result = mutableListOf<Triple<Int, String, String>>()

    for (customer1 in customers1) {
        for (customer2 in customers2) {
            if (customer1.first > customer2.first ||
                (customer1.second == customer2.second && customer1.third != customer2.third) ||
                (customer1.second != customer2.second && customer1.third == customer2.third)
            ) {
                result.add(customer1)
                break
            }
        }
    }

    return result
}