def parse_shuffle(line):
    """Parse line to tuple with shuffle type and parameter."""
    if line.startswith('cut'):
        return 'cut', int(line[3:])
    elif line.startswith('deal into'):
        return 'new stack', None
    elif line.startswith('deal with'):
        offset = len('deal with increment')
        return 'increment', int(line[offset:])