from collections import defaultdict
from axelrod.action import Action
from axelrod.player import Player
lllIIlIllllIII, lIllllll = Action.C, Action.D
class IlIlIIlIIIlI(Player):
    IIIllllIIII = "strategy"
    IIlIlIlllIlIIlIll = {
        "memory_depth": float("inf"),  
        "stochastic": False,
        "inspects_source": False,
        "long_run_time": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(IlIlIlIIlIIII, lIllIIIlIIllIlIllII: float = 0.1) -> None:
        super().__init__()
        IlIlIlIIlIIII.lIllIIIlIIllIlIllII = lIllIIIlIIllIlIllII
        IlIlIlIIlIIII.IllllIlI = defaultdict(int)  
    def llIlllIIlllIlIlI(IlIlIlIIlIIII, IlIIlIllIlllll: Player) -> Action:
        if len(IlIlIlIIlIIII.history):
            IIIIIllIIIl = (IlIlIlIIlIIII.history[-1], IlIIlIllIlllll.history[-1])
            IlIlIlIIlIIII.IllllIlI[IIIIIllIIIl] += 1
        lIlIIIIIlIlIIll = IlIlIlIIlIIII.IllllIlI[(lllIIlIllllIII, lIllllll)]
        IIlllllIIlIlI = IlIlIlIIlIIII.IllllIlI[(lIllllll, lllIIlIllllIII)]
        if lIlIIIIIlIlIIll > IIlllllIIlIlI * IlIlIlIIlIIII.lIllIIIlIIllIlIllII:
            return lIllllll
        return lllIIlIllllIII