from collections import deque
from typing import Iterable
from typing import Iterator


def tail(it: Iterable, n: int) -> Iterator:
    """
    Return an iterator over the last n items

    >>> [*tail('ABCDEFG', 3)]
    ['E', 'F', 'G']
    """
    return iter(deque(it, maxlen=n))