def prettify_state(state):
    """
    Returns a prettified puzzle state (or a 2D array in general)
    """
    return '\n\n'.join([''.join(['{:4}'.format(str(item)) for item in row]) 
        for row in state]).join('\n\n')