#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int matrix[6][6], a, b, c, d, minimum;
bool visited[6][6];
int pos[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
void dfs(int x1, int y1, int x2, int y2, int statue, int price){
if(x1...