from collections import defaultdict
from axelrod.action import Action
from axelrod.player import Player
lllIlIIllIIlIlIll, llIIlIllIIlIlI = Action.C, Action.D
class IIlllIlI(Player):
    lllIIlIlIIIlllllllll = "strategy"
    lIlllllI = {
        "memory_depth": float("inf"),  
        "stochastic": False,
        "inspects_source": False,
        "long_run_time": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(lIlIIIIllIl, IlIllIIl: float = 0.1) -> None:
        super().__init__()
        lIlIIIIllIl.IlIllIIl = IlIllIIl
        lIlIIIIllIl.IIIIIlIllll = defaultdict(int)  
    def lIIllIlIllIII(lIlIIIIllIl, llIlIIIlIlIlllII: Player) -> Action:
        if len(lIlIIIIllIl.history):
            IlIlllIII = (lIlIIIIllIl.history[-1], llIlIIIlIlIlllII.history[-1])
            lIlIIIIllIl.IIIIIlIllll[IlIlllIII] += 1
        llllllIlIIlIlII = lIlIIIIllIl.IIIIIlIllll[(lllIlIIllIIlIlIll, llIIlIllIIlIlI)]
        lIlIIlIIIlIlI = lIlIIIIllIl.IIIIIlIllll[(llIIlIllIIlIlI, lllIlIIllIIlIlIll)]
        if llllllIlIIlIlII > lIlIIlIIIlIlI * lIlIIIIllIl.IlIllIIl:
            return llIIlIllIIlIlI
        return lllIlIIllIIlIlIll
class IlIIllIIIlIlllIll(IIlllIlI):
    lllIIlIlIIIlllllllll = "strategy"
    def __init__(lIlIIIIllIl, IlIllIIl: float = 0.08) -> None:
        super().__init__(IlIllIIl=IlIllIIl)