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
llIllllIlII, lllllllIIIlI = Action.C, Action.D
lIIIIIIIIIl = (llIllllIlII, lllllllIIIlI)
IIIllIIIlllIIIl = Tuple[int, Action, int, Action]
class IIllIllIIIlIIl(Player):
    IllIIIIlllIIlIIllII = "strategy"
    llIIlIlIlIlllIIl: Dict[Text, Any] = {
        "memory_depth": 1,
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(
        IIIllllI,
        llIIlIIllI: Tuple[IIIllIIIlllIIIl, ...] = ((1, llIllllIlII, 1, llIllllIlII), (1, lllllllIIIlI, 1, lllllllIIIlI)),
        IlllIlll: int = 1,
        IlIIlIllIllllIIll: Action = llIllllIlII,
    ) -> None:
        Player.__init__(IIIllllI)
        IIIllllI.IlllIlll = IlllIlll
        IIIllllI.IlIIlIllIllllIIll = IlIIlIllIllllIIll
        IIIllllI.IIlllIIIIIIIllI = SimpleFSM(llIIlIIllI, IlllIlll)
    def IlIIIIllIlIlII(IIIllllI, IlllIIIIIlIIIIIlIlIl: Player) -> Action:
        if len(IIIllllI.history) == 0:
            return IIIllllI.IlIIlIllIllllIIll
        else:
            return IIIllllI.IIlllIIIIIIIllI.move(IlllIIIIIlIIIIIlIlIl.history[-1])