from typing import List, Optional
from axelrod.action import Action
from axelrod.player import Player
lIllllIlIIllIIl = List[float]
lIlIlIllIlI, lllIlIlIllll = Action.C, Action.D
class IIIlIllIllIlllllll(Player):
    lllllIlIIlIlIIIl = "strategy"
    lIIIlllIIlIIII = {
        "memory_depth": float("inf"),
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(llllIIll, IllllIIIIlIllIIll: Optional[List[Action]] = None) -> None:
        super().__init__()
        if IllllIIIIlIllIIll is None:
            llllIIll.IllllIIIIlIllIIll = [lIlIlIllIlI, lllIlIlIllll, lIlIlIllIlI, lIlIlIllIlI]
        else:
            llllIIll.IllllIIIIlIllIIll = IllllIIIIlIllIIll
    def lIIllllIIIllllIlIlll(llllIIll, IlIIIlIlllIlIlIlIIIl: Player) -> Action:
        IIlllllI = len(llllIIll.history)
        llllIIllIlIllll = len(llllIIll.IllllIIIIlIllIIll)
        if IIlllllI < llllIIllIlIllll:
            return llllIIll.IllllIIIIlIllIIll[IIlllllI]
        if lllIlIlIllll not in IlIIIlIlllIlIlIlIIIl.history[:llllIIllIlIllll]:
            return lllIlIlIllll
        return IlIIIlIlllIlIlIlIIIl.history[-1]