from axelrod.action import Action, actions_to_str
from axelrod.player import Player
from axelrod.strategy_transformers import (
    FinalTransformer,
    TrackHistoryTransformer,
)
llllIlIIlllllIlIl, llIIIlIlIlIllIIlIll = Action.C, Action.D
class IllIIIllll(Player):
    lIIllIIlll = "strategy"
    lllIlIll = {
        "memory_depth": 2,
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def llIIIIlIlII(IIlllIlIlllI, IllllIll: Player) -> Action:
        if len(IIlllIlIlllI.history) < 2:
            return llllIlIIlllllIlIl
        if IllllIll.history[-2] == IllllIll.history[-1]:
            return IllllIll.history[-1]
        return IIlllIlIlllI.history[-1]