from axelrod.action import Action
from axelrod.player import Player
IIllIllIllIIIllll, IIIlllIlIll = Action.C, Action.D
class IIllllIIIIIlllIIIIlI(Player):
    IIlllIll = "strategy"
    llIllIllIlIIIIllIIll = {
        "memory_depth": float("inf"),  
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def IIlIlIlllIlIl(lllIIllI, IlllllIIIllIllIIII: Player) -> Action:
        if len(IlllllIIIllIllIIII.history) == 0:
            return IIllIllIllIIIllll
        if len(IlllllIIIllIllIIII.history) < 10:
            if IlllllIIIllIllIIII.defections / len(IlllllIIIllIllIIII.history) > 0.2:
                return IIIlllIlIll
        if len(IlllllIIIllIllIIII.history) < 50:
            if IlllllIIIllIllIIII.defections / len(IlllllIIIllIllIIII.history) > 0.1:
                return IIIlllIlIll
        if len(IlllllIIIllIllIIII.history) < 100:
            if IlllllIIIllIllIIII.defections / len(IlllllIIIllIllIIII.history) > 0.05:
                return IIIlllIlIll
        return IIllIllIllIIIllll