import itertools
from typing import Any, Dict, List, Optional, Sequence, Text, Tuple
from axelrod.action import Action
from axelrod.evolvable_player import (
    EvolvablePlayer,
    InsufficientParametersError,
    copy_lists,
)
from axelrod.player import Player
llIIlIllIIIIllllIl, IlIIIIIIllIlIlIII = Action.C, Action.D
lIlIlIIIIIIlllIlII = (llIIlIllIIIIllllIl, IlIIIIIIllIlIlIII)
llllIllllIl = Tuple[int, Action, int, Action]
class lIllIIllIIIl(Player):
    llIIIIllllllIlll = "strategy"
    lllIIlIlllI: Dict[Text, Any] = {
        "memory_depth": 1,
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(
        IlIIllIIIlI,
        llIIIIlIlIlIIl: Tuple[llllIllllIl, ...] = ((1, llIIlIllIIIIllllIl, 1, llIIlIllIIIIllllIl), (1, IlIIIIIIllIlIlIII, 1, IlIIIIIIllIlIlIII)),
        IIlllIllll: int = 1,
        IlllIIlIII: Action = llIIlIllIIIIllllIl,
    ) -> None:
        Player.__init__(IlIIllIIIlI)
        IlIIllIIIlI.IIlllIllll = IIlllIllll
        IlIIllIIIlI.IlllIIlIII = IlllIIlIII
        IlIIllIIIlI.lIIIlIlIIIIllIIl = SimpleFSM(llIIIIlIlIlIIl, IIlllIllll)
    def llIlIIllIllllllIl(IlIIllIIIlI, IlIlIllII: Player) -> Action:
        if len(IlIIllIIIlI.history) == 0:
            return IlIIllIIIlI.IlllIIlIII
        else:
            return IlIIllIIIlI.lIIIlIlIIIIllIIl.move(IlIlIllII.history[-1])
class lIIIlIlIllIIlII(lIllIIllIIIl):
    llIIIIllllllIlll = "strategy"
    lllIIlIlllI = {
        "memory_depth": float("inf"),
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(IlIIllIIIlI) -> None:
        llIIIIlIlIlIIl = ((1, llIIlIllIIIIllllIl, 2, IlIIIIIIllIlIlIII), (1, IlIIIIIIllIlIlIII, 1, IlIIIIIIllIlIlIII), (2, llIIlIllIIIIllllIl, 1, IlIIIIIIllIlIlIII), (2, IlIIIIIIllIlIlIII, 1, llIIlIllIIIIllllIl))
        super().__init__(
            llIIIIlIlIlIIl=llIIIIlIlIlIIl, IIlllIllll=1, IlllIIlIII=IlIIIIIIllIlIlIII
        )