from axelrod.action import Action
from axelrod.player import Player
from axelrod.strategy_transformers import FinalTransformer
IlIllllIIllIIlIIIIII, IIlIIllIIIlIlIl = Action.C, Action.D
def IIIllllIIIIIIlII(IIIlIllIIIIlIllllIlI: Player) -> Action:
    if not IIIlIllIIIIlIllllIlI.history:
        return IlIllllIIllIIlIIIIII
    if IIIlIllIIIIlIllllIlI.defections > 3:
        return IIlIIllIIIlIlIl
    return IlIllllIIllIIlIIIIII
def lIlllIIIIIIIl(IIIlIllIIIIlIllllIlI: Player) -> Action:
    lllIlIIlllIIlIIIlllI = IIIlIllIIIIlIllllIlI.history[-2:]
    if lllIlIIlllIIlIIIlllI == [IIlIIllIIIlIlIl, IIlIIllIIIlIlIl]:
        return IIlIIllIIIlIlIl
    return IlIllllIIllIIlIIIIII
def IlllIIIlIIlIllllIII(IIIlIllIIIIlIllllIlI: Player) -> bool:
    lllIlIIlII = llIIIIllIllIl = 7
    IIllIIlllllIIIllIII = 180
    if IIlIIIlllIllllIIlIlI(IIIlIllIIIIlIllllIlI, llIIIIllIllIl):
        return False
    IllIlIlllllIlllIll = len(IIIlIllIIIIlIllllIlI.history) + 1
    return lllIlIIlII < IllIlIlllllIlllIll <= IIllIIlllllIIIllIII
def IIlIIIlllIllllIIlIlI(
    IIIlIllIIIIlIllllIlI: Player, llIIIIllIllIl: int
) -> bool:
    return IIlIIllIIIlIlIl in IIIlIllIIIIlIllllIlI.history[:llIIIIllIllIl]
class IlIIllIlIIllIIIIIIl(Player):
    lllIIIIIllIll = "strategy"
    IIllllIlIIlllIIIIIII = {
        "memory_depth": float("inf"),
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def IIIlIlllIIIIIIIIll(IIIlIlIIllIIIIll, IIIlIllIIIIlIllllIlI: Player) -> Action:
        return IIIllllIIIIIIlII(IIIlIllIIIIlIllllIlI)