def repunctuate_character(letters, punctuation):
    """Apply the recorded punctuation to a character. The letters must be
    an iterator of base characters."""
    if punctuation == 'UPPER':
        return next(letters).upper()
    elif punctuation == 'LOWER':
        return next(letters).lower()
    else:
        return punctuation