initial_prompt = """
There are several unique agents positioned on a two-dimensional n*n grid environment. The grid is a discrete space where each cell can be empty or occupied by either an agent, a goal, or an obstacle but not more than one simultaneously. Each agent is associated with a specific goal position on the grid.

Task: Navigate a two-dimensional grid to reach designated goal positions efficiently while obeying the following movement specifications and restrictions:

Allowed Actions: Only able to move horizontally or vertically (i.e., only being able to move to adjacent unoccupied cells) or wait at the current position.

Avoid Static Obstacles: Navigate around any immovable objects placed on the grid. You must not move through cells that contain these obstacles.

Prevent Collisions: You are not allowed to enter a cell that is occupied or about to be occupied by another agent.

Map Boundaries: Stay within the confines of the grid map. You are not permitted to move to a position outside the map's boundaries.

Optimize Time: Find the shortest and fastest route to your designated goal position. Your performance will be measured by the time taken to complete the task, so aim to reach the goal as quickly as possible. Prioritize taking actions that move agents directly to the goal. If both directions are blocked by obstacles or agents, try to move around if they are both obstacles or wait for a time step and let the agent move away then start the movement in the next timestep.

Do Not Block Paths: While navigating to your goal, be aware of other agents' goals and paths. Avoid actions that could prevent them from reaching their goal positions efficiently.

The origin (0,0) is placed in the bottom-left corner. The x-coordinate increases moves right,
and the y-coordinate increases moves up. Each coordinate on the x-axis and y-axis can range from 0 to n.

Question:
We have a 10*10 grid size environment.
These are the coordinates for static obstacles: [(4,5),(4,4),(4,3)], meaning no agent will be permitted to move into any of these cells.
These are the coordinates for agents' current positions in order: [(0,7), (3,1), (6,3), (5,7)]
These are the coordinates for agents' goals in order: [(1,9), (5,3), (3,4), (7,7)]

Considering the above specifications and restrictions, what should be the agents' actions for the next time-step? Give me actions in order for all 4 agents.

Answer:
For the agent in (0,7), the distance between the agent and its goal can be decomposed into 1 step to the right and 2 steps to the up. There are no agents or static obstacles adjacent to the agent. If we move up, the new cell is (0,8) which is not occupied by another agent or static obstacles and brings the agent closer to its goal at (1,9). Hence, let's choose UP for the next action.

For the agent in (3,1), the distance between the agent and its goal can be decomposed into 2 steps to the right and 2 steps to the up. There are no agents or static obstacles adjacent to the agent. If we move right, the new cell (4,1) is not occupied by another agent or static obstacles also brings the agent closer to its goal position at (6,3). Hence, let's choose RIGHT for the next action.

For the agent in (6,3), the distance between the agent and its goal can be decomposed into 3 steps to the left and 1 step to the up. There are no agents or static obstacles adjacent to the agent. But there are static obstacles on the shortest path to its goal, so the agent should consider long-term planning. Considering this, the distance between the agent and its goal can be decomposed into 1 step to the down, 3 steps to the left and 2 steps to the up. If we move down, the agent moves to (6,2) which brings the agent closer to the goal position at (3,4). Let's choose DOWN for the next action.

For the agent in (5,7), the distance between the agent and its goal can be decomposed into 2 steps to the right. There are no agents or static obstacles adjacent to the agent. If we move right, the new cell is (6,7) which is not occupied by another agent or static obstacles and brings the agent closer to its goal at (7,7). Hence, let's choose RIGHT for the next action.

Hence, the answer is ["UP", "RIGHT", "DOWN", "RIGHT"].

Question:
We have a 10*10 grid size environment.
These are the coordinates for static obstacles: [(4,5),(4,4),(4,3)], meaning no agent will be permitted to move into any of these cells.
These are the coordinates for agents' current positions in order: [(0,8), (4,1), (6,2), (6,7)]
These are the coordinates for agents' goals in order: [(1,9), (5,3), (3,4), (7,7)]

Considering the above specifications and restrictions, what should be the agents' actions for the next time-step? Give me actions in order for all 4 agents.

Answer:
For the agent in (0,8), the distance between the agent and its goal can be decomposed into 1 step to the right and 1 step to the up. There are no agents or static obstacles adjacent to the agent. If we move up, the new cell is (0,9) which is not occupied by another agent or static obstacles and brings the agent closer to its goal at (1,9). Hence, let's choose UP for the next action.

For the agent in (4,1), the distance between the agent and its goal can be decomposed into 1 step to the right and 2 steps to the up. There are no agents or static obstacles adjacent to the agent. If we move right, the new cell is (5,1) which is not occupied by another agent or static obstacles and brings the agent closer to its goal at (5,3). Hence, let's choose RIGHT for the next action.

For the agent in (6,2), the distance between the agent and its goal can be decomposed into 3 steps to the left and 2 steps to the up. There are no agents or static obstacles adjacent to the agent. If the agent goes up now, there may be static obstacles on the shortest path to its goal, the agent should consider long-term planning. Considering this, the agent should complete the left steps first, then go up. If the agent choses left, the new position will be (5,2) which brings the agent closer to its goal at (3,4). Let’s choose LEFT for the next action.

For the agent in (6,7), the distance between the agent and its goal can be decomposed into 1 step to the right. There are no agents or static obstacles adjacent to the agent. If we move right, the new cell is (7,7) which is not occupied by another agent or static obstacle and brings the agent to its goal at (7,7). Hence, let's choose RIGHT for the next position.

Hence, the answer is [“UP”, “RIGHT”, “LEFT”, “RIGHT”]

Question:
We have a 10*10 grid size environment.
These are the coordinates for static obstacles: [(0,8), (1,8), (2,8), (0,4), (1,3), (2,5), (2,4), (2,3), (2,2), (3,6), (3,2), (3,1), (4,1), (8,6), (8,5), (8,4), (8,3), (8,2), (8,1), (8,0), (9,6)], meaning no agent will be permitted to move into any of these cells.
These are the coordinates for agents' current positions in order: [(0,9), (2,9), (0,2), (5,2), (7,2)]
These are the coordinates for agents' goals in order: [(3,9), (1,9), (0,5), (9,2), (8,2)]

Considering the above specifications and restrictions, what should be the agents' actions for the next time-step? Give me actions in order for all 5 agents.

Answer:
For the agent in (0,9), the distance between the agent and its goal can be decomposed into 3 steps to the right. There is an obstacle adjacent to this agent at (0,8) so we will not be able to move down. The agent can move to the right. If we move right, the new cell is (1,9) which is not currently occupied by any agents or static obstacles and brings the agent closer to its goal. Let's choose RIGHT for the next action.

For the agent in (2,9), the distance between the agent and its goal can be decomposed into 1 step to the left. There are obstacles adjacent to the agent at (2,8) and an agent at (1,9), thus preventing this agent from moving to the down and to the left. The agent that is blocking needs to move right to arrive at its goal. To not block that agent’s path, we move to right now, the new cell is (3,9) which is not currently occupied by any agents or static obstacles and then continue to the goal once the agent has moved away. If the agent moves right, it will be in the (3,9) cell which is currently unoccupied. Let's choose RIGHT for the next action.

For the agent in (0,2), the distance between the agent and its goal can be decomposed into 3 steps to the up. There are no agents or static obstacles adjacent to the agent, however, if the agent goes up, there is a static obstacle at (0,4) on its path to the goal at (0,5). Considering the static obstacles on the agent’s path to its goal, the agent needs to move towards an obstacle-free path to its goal, so it needs to go around the obstacles. Going down accomplishes this and (0,1) is currently empty. Let’s choose DOWN for the next action.

For the agent in (5,2), the distance between the agent and its goal can be decomposed into 4 steps to the right. There are no agents or static obstacles adjacent to the agent. If we move right, the new cell is (6,2) which is not currently occupied by any agents or static obstacles and moves the agent closer to its goal at (9,2). Let’s choose RIGHT for the next action.

For the agent in (7,2), the distance between the agent and its goal can be decomposed into 1 step to the right. However, if we move right, the new cell will be (8,2) which is blocking another goal in (9,2) which is the goal for the agent currently in 8(5,2). To not block another agent’s path, we move up or down now. If we move up, the new cell is (7,3) which is not currently occupied by any agents or static obstacles. Let's choose UP for the next action.

Hence, the answer is ["RIGHT", "RIGHT", "DOWN", "RIGHT", "UP"].

Question:
We have a 10*10 grid size environment.
These are the coordinates for static obstacles: [(0,8), (1,8), (2,8), (0,4), (1,3), (2,5), (2,4), (2,3), (2,2), (3,6), (3,2), (3,1), (4,1), (8,6), (8,5), (8,4), (8,3), (8,2), (8,1), (8,0), (9,6)], meaning no agent will be permitted to move into any of these cells.
These are the coordinates for agents' current positions in order: [(1,9), (3,9), (0,1), (6,2), (7,3)]
These are the coordinates for agents' goals in order: [(3,9), (1,9), (0,5), (9,2), (8,2)]

Considering the above specifications and restrictions, what should be the agents' actions for the next time-step? Give me actions in order for all 5 agents.

Answer:
For the agent in (1,9), the distance between the agent and its goal can be decomposed into 2 steps to the right. There is a static obstacle at (1,8) meaning the agent is not allowed to move down. The agent can move to the right. If we move right, the new cell is (2,9) which is not currently occupied by any agents or static obstacles and moves the agent closer to its goal at (3,9). Let's choose RIGHT for the next action.

For the agent in (3,9), the distance between the agent and its goal can be decomposed into 2 steps to the left. However, if we move left, the new cell is (2,9) which will be occupied by another agent. To not block that agent's path, we move down now, the new cell is (3,8) which is not currently occupied by any agents or static obstacles. Let's choose DOWN for the next action.

For the agent in (0,1), the distance between the agent and its goal can be decomposed into 4 steps to the up. There are no agents or static obstacles adjacent to the agent. However, if the agent goes up, there is a static obstacle on its path to the goal at (0,4). Considering the static obstacles on the agent's path to its goal. The agent needs to move towards an obstacle-free path to its goal, so it needs to go around the obstacles. Let’s choose UP for the next action which moves the agent to (0,2) which is closer to the goal but be sure to remember that we have to move around the obstacle at (0,4).

For the agent in (6,2), the distance between the agent and its goal can be decomposed into 3 steps to the right. There are no agents or static obstacles adjacent to the agent. If we move right, the new cell is (7,2) which is not currently occupied by any agents or static obstacles and moves the agent closer to the goal at (9,2). Let’s choose RIGHT for the next action.

For the agent in (7,3), the distance between the agent and its goal can be decomposed into 1 step to the right and 1 step to the down. There is a static obstacles adjacent to the agent at (8,3) meaning the agent is not allowed to move to the right. There is also an agent at (7,2) meaning the agent is not allowed to move down. Hence, let’s choose WAIT for the next action and once the agent below moves, we can move down and get closer to the goal at (8,2).

Hence, the answer is ["RIGHT", "DOWN", "UP", "RIGHT", "WAIT"].

"""
