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
llllIIlI, IlIIIIll = Action.C, Action.D
lIIllllIlIIlIlIIII = (llllIIlI, IlIIIIll)
llIllllIlll = Tuple[int, Action, int, Action]
class lIIIIlIIlllIlIll(Player):
    lIlIIIIlI = "strategy"
    IllllIIllIIlllIIlI: Dict[Text, Any] = {
        "memory_depth": 1,
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(
        IlIllllI,
        IIlIIIlIIIII: Tuple[llIllllIlll, ...] = ((1, llllIIlI, 1, llllIIlI), (1, IlIIIIll, 1, IlIIIIll)),
        IlllIllIIIlIlIIlllll: int = 1,
        IIIIlIIllllIl: Action = llllIIlI,
    ) -> None:
        Player.__init__(IlIllllI)
        IlIllllI.IlllIllIIIlIlIIlllll = IlllIllIIIlIlIIlllll
        IlIllllI.IIIIlIIllllIl = IIIIlIIllllIl
        IlIllllI.IlIlIIIIlIlIIIlllll = SimpleFSM(IIlIIIlIIIII, IlllIllIIIlIlIIlllll)
    def IIllIlIIllI(IlIllllI, IIIlIIIlIlIlIlIII: Player) -> Action:
        if len(IlIllllI.history) == 0:
            return IlIllllI.IIIIlIIllllIl
        else:
            return IlIllllI.IlIlIIIIlIlIIIlllll.move(IIIlIIIlIlIlIlIII.history[-1])
class IlIlllIlIllIIIIlll(lIIIIlIIlllIlIll):
    lIlIIIIlI = "strategy"
    IllllIIllIIlllIIlI = {
        "memory_depth": 2,
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(IlIllllI) -> None:
        IIlIIIlIIIII = (
            (1, llllIIlI, 2, IlIIIIll),
            (1, IlIIIIll, 1, IlIIIIll),
            (2, llllIIlI, 2, llllIIlI),
            (2, IlIIIIll, 3, llllIIlI),
            (3, llllIIlI, 3, llllIIlI),
            (3, IlIIIIll, 3, llllIIlI),
        )
        super().__init__(
            IIlIIIlIIIII=IIlIIIlIIIII, IlllIllIIIlIlIIlllll=1, IIIIlIIllllIl=IlIIIIll
        )