from typing import List
import numpy as np
from axelrod.action import Action
from axelrod.interaction_utils import compute_final_score
from axelrod.player import Player
from axelrod.strategies.finite_state_machines import FSMPlayer
IllllIIIlIIIII, IIlIIIIIlIII = Action.C, Action.D
class IIIIllllllIlIlll(Player):
    IlllIIIIlllIIlIl = "strategy"
    IlIlllIllllIIII = {
        "memory_depth": float("inf"),
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def __init__(llllIIlllIIlIIlll):
        super().__init__()
        llllIIlllIIlIIlll.IIIIlIlIlIlII = 0
        llllIIlllIIlIIlll.llIlIIlIIIIIIllIIIl = "Normal"
    def IlIllllIIlII(llllIIlllIIlIIlll, IllIIlIIlIIlIIIIIIlI: Player):
        lllIlIllIl = llllIIlllIIlIIlll.match_attributes["game"]
        lllllIlIII = (llllIIlllIIlIIlll.history[-1], IllIIlIIlIIlIIIIIIlI.history[-1])
        llllIIlllIIlIIlll.IIIIlIlIlIlII += lllIlIllIl.score(lllllIlIII)[0]
    def IIIIIIllIl(llllIIlllIIlIIlll, IllIIlIIlIIlIIIIIIlI: Player) -> Action:
        if llllIIlllIIlIIlll.llIlIIlIIIIIIllIIIl == "Defect":
            return IIlIIIIIlIII
        IlIIIIlIIllI = len(llllIIlllIIlIIlll.history) + 1
        if IlIIIIlIIllI == 1:
            return IllllIIIlIIIII
        llllIIlllIIlIIlll.IlIllllIIlII(IllIIlIIlIIlIIIIIIlI)
        if (
            IlIIIIlIIllI == 11
            and llllIIlllIIlIIlll.IIIIlIlIlIlII < 23
            or IlIIIIlIIllI == 21
            and llllIIlllIIlIIlll.IIIIlIlIlIlII < 53
            or IlIIIIlIIllI == 31
            and llllIIlllIIlIIlll.IIIIlIlIlIlII < 83
            or IlIIIIlIIllI == 41
            and llllIIlllIIlIIlll.IIIIlIlIlIlII < 113
            or IlIIIIlIIllI == 51
            and llllIIlllIIlIIlll.IIIIlIlIlIlII < 143
            or IlIIIIlIIllI == 101
            and llllIIlllIIlIIlll.IIIIlIlIlIlII < 293
        ):
            llllIIlllIIlIIlll.llIlIIlIIIIIIllIIIl = "Defect"
            return IIlIIIIIlIII
        return IllIIlIIlIIlIIIIIIlI.history[-1]