def n_gon_to_representation(n_gon: List[int]) -> int:
    n_gon_str = [str(n) for n in n_gon]
    size = (len(n_gon_str) // 2)
    result = ''
    minimal = min(n_gon[0], *n_gon[3::2])
    index = n_gon.index(minimal)
    start = ((n_gon.index(minimal) // 2) if (index >= 3) else 0)
    for i in range(start, (start + size)):
        current = (i % size)
        if (current == 0):
            result += ''.join(n_gon_str[0:3])
        elif (current == (size - 1)):
            result += ''.join([n_gon_str[(- 1)], n_gon_str[(- 2)], n_gon_str[1]])
        else:
            result += ''.join([n_gon_str[((current * 2) + 1)], n_gon_str[(current * 2)], n_gon_str[((current * 2) + 2)]])
    return int(result)
def n_gon_to_representation(n_gon: List[int]) -> int:
    n_gon_str = [str(n) for n in n_gon]
    size = (len(n_gon_str) // 2)
    result = 
    minimal = min(n_gon[0], *n_gon[3::2])
    index = n_gon.index(minimal)
    start = ((n_gon.index(minimal) // 2) if (index >= 3) else 0)
    for i in range(start, (start + size)):
        current = (i % size)
        if (current == 0):
            result += .join(n_gon_str[0:3])
        elif (current == (size - 1)):
            result += .join([n_gon_str[(- 1)], n_gon_str[(- 2)], n_gon_str[1]])
        else:
            result += .join([n_gon_str[((current * 2) + 1)], n_gon_str[(current * 2)], n_gon_str[((current * 2) + 2)]])
    return int(result)