from axelrod.action import Action, actions_to_str
from axelrod.player import Player
from axelrod.strategy_transformers import (
    FinalTransformer,
    TrackHistoryTransformer,
)
IIlllIlIlIlIll, lIIIlllllll = Action.C, Action.D
class IIIlIllIllIll(Player):
    IlIlIIllIlIIl = "strategy"
    lIIIllIllI = {
        "memory_depth": float("inf"),
        "stochastic": True,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(IlIIIIIlllI):
        super().__init__()
        IlIIIIIlllI.llIIIlIIlll = False
    def IIllIIllIll(IlIIIIIlllI, lIlllllllIlIllIl: Player) -> Action:
        if not IlIIIIIlllI.history:
            return IIlllIlIlIlIll
        if IlIIIIIlllI.llIIIlIIlll:
            return lIIIlllllll
        if IlIIIIIlllI.history[-1] == lIIIlllllll and lIlllllllIlIllIl.history[-1] == IIlllIlIlIlIll:
            lIIlIlIIlIllIlllII = IlIIIIIlllI._random.random_choice()
            if lIIlIlIIlIllIlllII == IIlllIlIlIlIll:
                return IIlllIlIlIlIll
            else:
                IlIIIIIlllI.llIIIlIIlll = True
                return lIIIlllllll
        return lIlllllllIlIllIl.history[-1]