from axelrod.action import Action
from axelrod.player import Player
from axelrod.strategy_transformers import FinalTransformer
llllIIlII, llIlIlIIIlIIlIIl = Action.C, Action.D
def lIIIlIIllIllIIlIl(IlllllII: Player) -> Action:
    if not IlllllII.history:
        return llllIIlII
    if IlllllII.defections > 3:
        return llIlIlIIIlIIlIIl
    return llllIIlII
def lllIllIllllllllIIIll(IlllllII: Player) -> Action:
    IlIllIlIIlIllIlIII = IlllllII.history[-2:]
    if IlIllIlIIlIllIlIII == [llIlIlIIIlIIlIIl, llIlIlIIIlIIlIIl]:
        return llIlIlIIIlIIlIIl
    return llllIIlII
def IIIlIIlIIIlIlIlIll(IlllllII: Player) -> bool:
    lIIllIllIlIlIl = lIllIlIlIIIIllIl = 7
    IIlIIlIllIlllIIlIl = 180
    if IlIIIlIIllllIIlIlI(IlllllII, lIllIlIlIIIIllIl):
        return False
    IlIIllIIlIIIIlIlIlII = len(IlllllII.history) + 1
    return lIIllIllIlIlIl < IlIIllIIlIIIIlIlIlII <= IIlIIlIllIlllIIlIl
def IlIIIlIIllllIIlIlI(
    IlllllII: Player, lIllIlIlIIIIllIl: int
) -> bool:
    return llIlIlIIIlIIlIIl in IlllllII.history[:lIllIlIlIIIIllIl]
class lIllIIIlIIIllllIllI(Player):
    lIllIIIlIIIIlIlI = "strategy"
    llIlIIIII = {
        "memory_depth": float("inf"),
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def IIIIIllllIllIlIlI(IIlIIlIlI, IlllllII: Player) -> Action:
        if IIIlIIlIIIlIlIlIll(IlllllII):
            return lllIllIllllllllIIIll(IlllllII)
        return lIIIlIIllIllIIlIl(IlllllII)