from axelrod.action import Action, actions_to_str
from axelrod.player import Player
from axelrod.strategy_transformers import (
    FinalTransformer,
    TrackHistoryTransformer,
)
IlIIlllI, lIllIlllIIlllIlIlII = Action.C, Action.D
class IllllIIlII(Player):
    IlllIlllIIII = "strategy"
    IIIllIIll = {
        "memory_depth": float("inf"),
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(lIIllIlllIIlll) -> None:
        super().__init__()
        lIIllIlllIIlll.IIlIlIlllIlIlIlll = 0
        lIIllIlllIIlll.IIllllllIllllIllIllI = 0
    def lIlllIIlIIIl(lIIllIlllIIlll, lIlIIIlIIIIlllIII: Player) -> Action:
        if len(lIIllIlllIIlll.history) == 0:
            return IlIIlllI
        if lIIllIlllIIlll.IIllllllIllllIllIllI > 0:
            lIIllIlllIIlll.IIllllllIllllIllIllI -= 1
            return lIllIlllIIlllIlIlII
        if lIIllIlllIIlll.IIlIlIlllIlIlIlll > 0:
            lIIllIlllIIlll.IIlIlIlllIlIlIlll -= 1
            return IlIIlllI
        if lIlIIIlIIIIlllIII.history[-1] == lIllIlllIIlllIlIlII:
            lIIllIlllIIlll.IIllllllIllllIllIllI = lIlIIIlIIIIlllIII.defections - 1
            lIIllIlllIIlll.IIlIlIlllIlIlIlll = 2
            return lIllIlllIIlllIlIlII
        return IlIIlllI