def decompose_to_twos_and_threes(n):
    """
    Split an integer into a list of 2's and possible one 3 that add up to it

    :param n: the int
    :return: a list of 2's and possible one three
    """
    if not isinstance(n, int) and n >= 2:
        raise ValueError('n must be an integer greater than or equal to 2.')
    out = []
    if n % 2 == 1:
        n -= 3
        out.append(3)
    while n > 0:
        n -= 2
        out.append(2)
    out.reverse()
    return out
