def file_reader(filename):
    """Read triangle file into list of ints."""
    with open(filename) as f:
        tree = []
        for line in f.readlines():
            weights = [int(x) for x in line.split()]
            tree.append(weights)
        return tree