import itertools


def nth(n, seq):
    """ The nth element in a sequence

    >>> nth(1, 'ABC')
    'B'
    """
    try:
        return seq[n]
    except TypeError:
        return next(itertools.islice(seq, n, None))