static int DFS(int r, int c, int t) {
		int s = side(r, c);
		for (int[] d : dir)
			if (inside(r + d[0], c + d[1]) && v[r + d[0]][c + d[1]] != t && on[r + d[0]][c + d[1]]) {
				v[r + d[0]][c + d[1]] = t;
				s |= DFS(r + d[0], c + d[1], t);
			}
		return s;
	}