#define _USE_MATH_DEFINES
#define DEBUG
// #define USE_ONLY_SPANNINGTREE
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include <utility>
#include <complex>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <random>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef complex<ld> compd;
#define rep(i, n) for (int i = 0; i < n; i++)
#define srep(i, a, n) for (int i = a; i < n; i++)
#define REP(i, n) for (int i = 0; i <= n; i++)
#define SREP(i, a, n) for (int i = a; i <= n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define RREP(i, n) for (int i = n; i >= 0; i--)
#define all(a) (a).begin(), (a).end()
#define mp(a, b) make_pair(a, b)
#define mt make_tuple
#define pb push_back
#define fst first
#define scn second
#define bicnt(x) __buildin__popcount(x)
#define gcd(a, b) __gcd__(a, b)
#define debug(x) cout << "debug: " << x << endl
const ll inf = (ll)1e18;
const ll mod = 1e9 + 7;
const ld eps = 1e-9;
const int dx[] = {0, -1, 1, 0, 1, -1, 1, -1};
const int dy[] = {-1, 0, 0, 1, 1, 1, -1, -1};

#ifdef DEBUG
#include <chrono>
class TimeWatcher
{
	chrono::system_clock::time_point start;

  public:
	void start_clock()
	{
		start = chrono::system_clock::now();
	}
	int check()
	{
		auto end = chrono::system_clock::now();
		return chrono::duration_cast<chrono::milliseconds>(end - start).count();
	}
} timer;
#else
#include <sys/time.h>
class TimeWatcher
{
	struct timeval s;

  public:
	void start_clock()
	{
		gettimeofday(&s, NULL);
	}
	int check()
	{
		struct timeval t;
		gettimeofday(&t, NULL);
		int stime = s.tv_sec * 1000 + s.tv_usec / 1000;
		int ttime = t.tv_sec * 1000 + t.tv_usec / 1000;
		return ttime - stime;
	}
} timer;
#endif

class RandomMaker
{
	random_device rnd;
	mt19937 mt;

  public:
	void setup()
	{
		mt.seed(rnd());
	}
	int rand()
	{
		return mt();
	}
	int rand(int a, int b)
	{
		uniform_int_distribution<> r(a, b);
		int ret = r(mt);
		return ret;
	}
} rnd;
#define ranodm rand

void init()
{
	timer.start_clock();
	rnd.setup();
}

inline double getdist(int x1, int y1, int x2, int y2)
{
	return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}

class P
{
  public:
	int x, y;
	P() : x(0), y(0){};
	P(double X, double Y) : x(X), y(Y) {}
};
inline P operator+(const P &a, const P &b)
{
	return P(a.x + b.x, a.y + b.y);
}
inline P operator-(const P &a, const P &b)
{
	return P(a.x - b.x, a.y - b.y);
}
inline P operator*(const double &a, const P &b)
{
	return P(a * b.x, a * b.y);
}
inline P operator/(const double &a, const P &b)
{
	return P(b.x / a, b.y / a);
}
inline bool operator==(const P &a, const P &b)
{
	return a.x == b.x and a.y == b.y;
}
inline bool operator!=(const P &a, const P &b)
{
	return !(a == b);
}
inline bool operator>(const P &a, const P &b)
{
	return (a.x == b.x and a.y > b.y) or a.x > b.x;
}
inline bool operator>=(const P &a, const P &b)
{
	return (a.x == b.x and a.y >= b.y) or a.x >= b.x;
}
inline bool operator<(const P &a, const P &b)
{
	return (a.x == b.x and a.y < b.y) or a.x < b.x;
}
inline bool operator<=(const P &a, const P &b)
{
	return (a.x == b.x and a.y <= b.y) or a.x <= b.x;
}
inline double abs2(const P &a)
{
	return a.x * a.x + a.y * a.y;
}
inline double abs(const P &a)
{
	return sqrt(abs2(a));
}
inline double arg(const P &a)
{
	if (a.x < 0)
		return (atan2(-a.y, -a.x) + M_PI);
	double ret = atan2(a.y, a.x);
	return ret < 0 ? ret + 2 * M_PI : ret;
}
inline double dot(const P &a, const P &b)
{
	return a.x * b.x + a.y * b.y;
}
inline double det(const P &a, const P &b)
{
	return a.x * b.y - a.y * b.x;
}
inline double getdist(const P &a, const P &b)
{
	return abs(a - b);
}
inline double radToDeg(double r)
{
	return r * 180 / M_PI;
}
inline double degToRad(double r)
{
	return r * M_PI / 180;
}

const int n = 10;
int block[11][11];
const int getx[] = {2, 0, -2, 0};
const int gety[] = {0, 2, 0, -2};
inline bool isInside(const P &a)
{
	return (0 <= a.x && a.x < n) && (0 <= a.y && a.y < n);
}

int main()
{
	init();
	int t;
	cin >> t;
	rep(i, n) rep(j, n) cin >> block[i + 1][j + 1];
	vector<P> pos;
	SREP(i, 1, n)
	SREP(j, 1, n)
	{
		if (block[i][j] < 0)
			pos.push_back(P(i, j));
	}
	if (t < 3)
	{
		cout << 10 << " " << 2 + t * 3 << " " << 1 << endl;
		return 0;
	}
	if (pos.size() == 0)
	{
		// set randomly
		int cx = rnd.rand(2, 9);
		int cy = rnd.rand(2, 9);
		int dir = rnd.rand(0, 1);
		cout << cx << " " << cy << " " << dir << endl;
	}
	// secret algorithm hahaha :)
	else if (pos.size() == 1)
	{
		if (pos[0].y == 10)
			pos[0].y--;
		else if (pos[0].y == 1)
			pos[0].y++;
		cout << pos[0].x << " " << pos[0].y << " " << 1 << endl;
	}
	else
	{
		P c(-1, -1);
		int dir = -1;
		rep(i, pos.size())
		{
			bool flag = false;
			rep(j, 4)
			{
				P to = pos[i] + P(getx[j], gety[j]);
				if (block[(int)to.x][(int)to.y] < 0)
				{
					dir = (to - pos[i]).x != 0 ? 0 : 1;
					c = P(pos[i].x + getx[j] / 2, pos[i].y + gety[j] / 2);
					goto hoge;
				}
			}
		}
	hoge:;
		if (dir == -1)
		{
			// contain pos[0]
			dir = rnd.rand(0, 1);
			if (dir == 0)
			{
				if (pos[0].x == 1)
					pos[0].x++;
				else if (pos[0].x == 10)
					pos[0].x--;
			}
			else
			{
				if (pos[0].y == 1)
					pos[0].y++;
				else if (pos[0].y == 10)
					pos[0].y--;
			}
			printf("%d %d %d\n", pos[0].x, pos[0].y, dir);
		}
		else
		{
			//cerr << "HOge" << endl;
			printf("%d %d %d\n", c.y, c.x, dir);
		}
	}
	return 0;
}
/*
testcase 
3
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 1 1 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 -1 0 0 0 0 -1 0 0 0
0 0 0 0 0 0 -1 0 0 0
0 0 0 0 0 0 -1 0 0 0
0 0 0 0 0 0 0 0 0 0
*/

Battle History

OpponentConfigResultDate
BOT (random)Lose2018/05/20 15:13:43