from axelrod.action import Action, actions_to_str
from axelrod.player import Player
from axelrod.strategy_transformers import (
    FinalTransformer,
    TrackHistoryTransformer,
)
lIlllIlIlllIl, lllIlIIlll = Action.C, Action.D
class llIIIlllIIlII(Player):
    IlIIIIIlIIlIlIl = "strategy"
    IIlIlIIllllIlIlIll = {
        "memory_depth": 3,
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(lIllIIIIll):
        super().__init__()
        lIllIIIIll.IIlIIlllIIllIlllI = False
        lIllIIIIll.IIIllllIllll = []
    def lIIIIIIlIIl(lIllIIIIll, IlIIIllllIlIIl: Player) -> Action:
        if not IlIIIllllIlIIl.history:
            return lIlllIlIlllIl
        if lIllIIIIll.IIlIIlllIIllIlllI and lIllIIIIll.history[-1] == lIlllIlIlllIl:
            lIllIIIIll.IIlIIlllIIllIlllI = False
            return lIlllIlIlllIl
        if lIllIIIIll.IIIllllIllll[-1] != lIllIIIIll.history[-1]:  
            if lIllIIIIll.history[-1] == lllIlIIlll and IlIIIllllIlIIl.history[-1] == lIlllIlIlllIl:
                lIllIIIIll.IIlIIlllIIllIlllI = True
        return IlIIIllllIlIIl.history[-1]