from collections import defaultdict
from axelrod.action import Action
from axelrod.player import Player
lIlllllllIlll, IlIIlIllIllIllllll = Action.C, Action.D
class IlIllIIl(Player):
    IllIIllIlllllIIll = "strategy"
    llIIllllIlI = {
        "memory_depth": float("inf"),  
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(
        IIllIIlllllIlIllIII, IIIIIlllI: float = 0.1, llllIllIlll: int = 20
    ) -> None:
        super().__init__()
        IIllIIlllllIlIllIII.IIllIllIlIIII = False
        IIllIIlllllIlIllIII.IlIlIIIlllIIl = 0
        IIllIIlllllIlIllIII.IIIIIlllI = IIIIIlllI
        IIllIIlllllIlIllIII.llllIllIlll = llllIllIlll
        IIllIIlllllIlIllIII.IllllIIlIIIIIIIlllI = defaultdict(int)  
    def IIIIIIllIl(IIllIIlllllIlIllIII, IIlllIIIIllIlI: Player) -> Action:
        if len(IIllIIlllllIlIllIII.history):
            lIlIIllI = (IIllIIlllllIlIllIII.history[-1], IIlllIIIIllIlI.history[-1])
            IIllIIlllllIlIllIII.IllllIIlIIIIIIIlllI[lIlIIllI] += 1
        IllIIlIlIIlllIIIII = IIllIIlllllIlIllIII.IllllIIlIIIIIIIlllI[(lIlllllllIlll, IlIIlIllIllIllllll)]
        IllIlIllllllllIl = IIllIIlllllIlIllIII.IllllIIlIIIIIIIlllI[(IlIIlIllIllIllllll, lIlllllllIlll)]
        if IllIIlIlIIlllIIIII > IllIlIllllllllIl * IIllIIlllllIlIllIII.IIIIIlllI:
            IIllIIlllllIlIllIII.IIllIllIlIIII = True
        else:
            IIllIIlllllIlIllIII.IIllIllIlIIII = False
            IIllIIlllllIlIllIII.IlIlIIIlllIIl = 0
        if IIllIIlllllIlIllIII.IIllIllIlIIII:
            if IIllIIlllllIlIllIII.IlIlIIIlllIIl < IIllIIlllllIlIllIII.llllIllIlll:
                IIllIIlllllIlIllIII.IlIlIIIlllIIl += 1
                return IlIIlIllIllIllllll
            else:
                IIllIIlllllIlIllIII.IlIlIIIlllIIl = 0
                IIllIIlllllIlIllIII.IIllIllIlIIII = False
        return lIlllllllIlll
class lIlllIlllllIIIlII(IlIllIIl):
    IllIIllIlllllIIll = "strategy"
    def __init__(
        IIllIIlllllIlIllIII, IIIIIlllI: float = 0.08, llllIllIlll: int = 15
    ) -> None:
        super().__init__(
            IIIIIlllI=IIIIIlllI,
            llllIllIlll=llllIllIlll,
        )