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
IIllllIIllIIlIlIlII, IllIIIllllIll = Action.C, Action.D
IllIlIllI = (IIllllIIllIIlIlIlII, IllIIIllllIll)
lllIIIll = Tuple[int, Action, int, Action]
class IIIlIIlllIIIIII(Player):
    llIlIIllII = "strategy"
    lIIllIlI: Dict[Text, Any] = {
        "memory_depth": 1,
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(
        llllIIIlIIIIlIllII,
        IIIIIllIllIllIIIlIl: Tuple[lllIIIll, ...] = ((1, IIllllIIllIIlIlIlII, 1, IIllllIIllIIlIlIlII), (1, IllIIIllllIll, 1, IllIIIllllIll)),
        IIIIlIlIIl: int = 1,
        lIIlIIlI: Action = IIllllIIllIIlIlIlII,
    ) -> None:
        Player.__init__(llllIIIlIIIIlIllII)
        llllIIIlIIIIlIllII.IIIIlIlIIl = IIIIlIlIIl
        llllIIIlIIIIlIllII.lIIlIIlI = lIIlIIlI
        llllIIIlIIIIlIllII.IllllIlllIllI = SimpleFSM(IIIIIllIllIllIIIlIl, IIIIlIlIIl)
    def IlIllIlIl(llllIIIlIIIIlIllII, lllllllllIlIllI: Player) -> Action:
        if len(llllIIIlIIIIlIllII.history) == 0:
            return llllIIIlIIIIlIllII.lIIlIIlI
        else:
            return llllIIIlIIIIlIllII.IllllIlllIllI.move(lllllllllIlIllI.history[-1])
class IIIIIIlIIIllI(IIIlIIlllIIIIII):
    llIlIIllII = "strategy"
    lIIllIlI = {
        "memory_depth": float("inf"),
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(llllIIIlIIIIlIllII) -> None:
        IIIIIllIllIllIIIlIl = (
            (2, IIllllIIllIIlIlIlII, 2, IllIIIllllIll),
            (2, IllIIIllllIll, 7, IllIIIllllIll),
            (3, IIllllIIllIIlIlIlII, 6, IllIIIllllIll),
            (3, IllIIIllllIll, 4, IIllllIIllIIlIlIlII),
            (4, IIllllIIllIIlIlIlII, 4, IIllllIIllIIlIlIlII),
            (4, IllIIIllllIll, 6, IllIIIllllIll),
            (5, IIllllIIllIIlIlIlII, 2, IllIIIllllIll),
            (5, IllIIIllllIll, 7, IllIIIllllIll),
            (6, IIllllIIllIIlIlIlII, 3, IIllllIIllIIlIlIlII),
            (6, IllIIIllllIll, 5, IllIIIllllIll),
            (7, IIllllIIllIIlIlIlII, 2, IIllllIIllIIlIlIlII),
            (7, IllIIIllllIll, 3, IllIIIllllIll),
        )
        super().__init__(
            IIIIIllIllIllIIIlIl=IIIIIllIllIllIIIlIl, IIIIlIlIIl=4, lIIlIIlI=IIllllIIllIIlIlIlII
        )