#include using namespace std; int main() { cin.tie(0);ios::sync_with_stdio(false); int N; cin >> N; array,500> grid; for(int i=0;i