from axelrod.action import Action, actions_to_str
from axelrod.player import Player
from axelrod.strategy_transformers import (
    FinalTransformer,
    TrackHistoryTransformer,
)
IIlIIlIlllI, lIIIllIlllIIlllllIlI = Action.C, Action.D
class IIIIIlIIlIlIIIlll(Player):
    IllIIIIlIll = "strategy"
    lIlIlIllIl = {
        "memory_depth": float("inf"),
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(IlIlIllIII, IIIlIllllll: int = 3, llllIIIIlIllllIIll: int = 2) -> None:
        super().__init__()
        IlIlIllIII.IIIlIllllll = IIIlIllllll
        IlIlIllIII.llllIIIIlIllllIIll = llllIIIIlIllllIIll
        IlIlIllIII.lIlIlIllIl["memory_depth"] = max([llllIIIIlIllllIIll, IIIlIllllll])
        IlIlIllIII.llIlIIlIIIIlIIII = 0
    def llIIllIlIIIllIII(IlIlIllIII, llIIlIlIIIlIIIIlIll: Player) -> Action:
        if not IlIlIllIII.llllIIIIlIllllIIll or llIIlIlIIIlIIIIlIll.history[-IlIlIllIII.llllIIIIlIllllIIll :].count(lIIIllIlllIIlllllIlI) == IlIlIllIII.llllIIIIlIllllIIll:
            IlIlIllIII.llIlIIlIIIIlIIII = IlIlIllIII.IIIlIllllll
        if IlIlIllIII.llIlIIlIIIIlIIII:
            IlIlIllIII.llIlIIlIIIIlIIII -= 1
            return lIIIllIlllIIlllllIlI
        return IIlIIlIlllI