def argmax(pairs):

    """
    Given an iterable of pairs return the key corresponding to the greatest
    value.

    Parameters:
    :param pairs : iterable of pairs

    Outputs:
    :returns argmax_val : key corresponding to greatest value
    """

    argmax_val = max(pairs, key=lambda x: x[1])[0]

    return argmax_val