import re


def get_inputs( filename ):
    """
    Each line in the input file contains directions to a tile
    starting from the origin.
    This function returns a list of lists with directions to each tile.
    """
    with open( filename, 'r' ) as input_file:
        raw_data = input_file.read().splitlines()
    directions = 'e|se|sw|w|nw|ne'
    tiles = []
    for line in raw_data:
        tile = re.findall( directions, line )
        tiles.append( tile )
    return tiles