private void foreach(Ant ant) {
		Direction direction;
		Position base = getBase(ant);
		
		if(ant.getHealth() < 3) {
			direction = tomtom.navigate(ant.getX(), ant.getY(), base.getX(), base.getY());
		} else {
			if (!ant.isSweet()) {
				if (freeSugar.isEmpty()) {
					direction = tomtom.navigate(ant.getX(), ant.getY(), base.getX(), base.getY());
				} else {
					direction = getDirectionToNearestSugar(ant);
					antCounter.remove(ant.getId());
				}
			} else {
				direction = tomtom.navigate(ant.getX(), ant.getY(), base.getX(), base.getY());
				int c = 0;
				if (!antCounter.containsKey(ant.getId())) antCounter.put(ant.getId(), c);
				else c = antCounter.get(ant.getId());
				if (antCounter.get(ant.getId()) < 20) {
					int f[] = {3,6,9,8,0,7,4,1,2};
					int n = f[direction.getNum()-1];
					direction = Direction.getDirection(n);
					antCounter.put(ant.getId(), c+1);
				}
				
				if(isSugarInFrontOfAnt(ant)) {
					int f[] = {3,6,9,8,0,7,4,1,2};
					int n = f[direction.getNum()-1];
					direction = Direction.getDirection(n);
				}
			}
		}
		
		Ant other = getNextOpponent(ant);
		if (other!=null && (Navi.calcDist(ant.getX(), ant.getY(), other.getX(), other.getY())<8)) {
			int dx = ant.getX() - other.getX();
			int dy = ant.getY() - other.getY();
			direction = Direction.fromDelta(dx, dy);
		}

		ant.setDirection(direction);
	}