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
llllIlIllIIIl, lllIlIIIllIIlllI = Action.C, Action.D
IllllIIIlIlIllll = (llllIlIllIIIl, lllIlIIIllIIlllI)
lIlllIIIlI = Tuple[int, Action, int, Action]
class llIIllIIlIIlIlllIIIl(Player):
    llIlIIll = "strategy"
    lIIIIIIlllllIlIl: Dict[Text, Any] = {
        "memory_depth": 1,
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(
        IllIIIIIIlIlIll,
        IllIlIIlI: Tuple[lIlllIIIlI, ...] = ((1, llllIlIllIIIl, 1, llllIlIllIIIl), (1, lllIlIIIllIIlllI, 1, lllIlIIIllIIlllI)),
        IlIIlIIIllIIIIIIIIl: int = 1,
        llIllIll: Action = llllIlIllIIIl,
    ) -> None:
        Player.__init__(IllIIIIIIlIlIll)
        IllIIIIIIlIlIll.IlIIlIIIllIIIIIIIIl = IlIIlIIIllIIIIIIIIl
        IllIIIIIIlIlIll.llIllIll = llIllIll
        IllIIIIIIlIlIll.IIIlIlIIlIllII = SimpleFSM(IllIlIIlI, IlIIlIIIllIIIIIIIIl)
    def IIIllllIlIllIlIlll(IllIIIIIIlIlIll, IlIlIIIIIlIllIIlI: Player) -> Action:
        if len(IllIIIIIIlIlIll.history) == 0:
            return IllIIIIIIlIlIll.llIllIll
        else:
            return IllIIIIIIlIlIll.IIIlIlIIlIllII.move(IlIlIIIIIlIllIIlI.history[-1])
class IlIIIIIIlIlIIlIIlIl(llIIllIIlIIlIlllIIIl):
    llIlIIll = "strategy"
    lIIIIIIlllllIlIl = {
        "memory_depth": 3,
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(IllIIIIIIlIlIll) -> None:
        IllIlIIlI = (
            (1, llllIlIllIIIl, 2, llllIlIllIIIl),
            (1, lllIlIIIllIIlllI, 3, llllIlIllIIIl),
            (2, llllIlIllIIIl, 1, lllIlIIIllIIlllI),
            (2, lllIlIIIllIIlllI, 3, llllIlIllIIIl),
            (3, llllIlIllIIIl, 3, llllIlIllIIIl),  
            (3, lllIlIIIllIIlllI, 3, lllIlIIIllIIlllI),
        )
        super().__init__(
            IllIlIIlI=IllIlIIlI, IlIIlIIIllIIIIIIIIl=1, llIllIll=lllIlIIIllIIlllI
        )