from typing import Counter


def sagan_ip_path(trace):
    """given an sagan traceroute measurement obj,
    return a list of IP hop, each hop contain only one IP address.

    Args:
        trace (ripe.atlas.sagan.traceroute.TracerouteResult): one single instance of traceroute measurement;
            in sagan object, for each hop, have at most three IP address.

    Returns:
        single_path (list): e.x. ['137.194.164.254', '137.194.4.240', '212.73.200.45', ...]
            that is one IP per hop
    """
    single_path = []
    full_path = trace.ip_path
    for hops in full_path:
        single_path.append(Counter(hops).most_common(1)[0][0])
    return single_path