static int move(int map, int fleas, int r, int c, int d, int x, int y) {
		int f = 0;
		int[] m = mm[d];
		for (int i = 0; i < 6; i++)
			f = s(f, m[i], g(fleas, i));
		if (g(f, 5) == 1 && g(map, x * 4 + y) == 0) {
			f = s(f, 5, 0);
			map = s(map, x * 4 + y, 1);
		} else if (g(map, x * 4 + y) == 1 && g(f, 5) == 0) {
			f = s(f, 5, 1);
			map = s(map, x * 4 + y, 0);
		}
		return build(map, x, y, f);
	}