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
llIllIIlIlIlI, lIIIIIIlIllIIl = Action.C, Action.D
class lIIlllIIIIlIIII(Player):
    llIIlIllIlIIIIIlIl = "strategy"
    IllllllllIll = {
        "memory_depth": 8,
        "stochastic": False,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def lIIlIIIIlIll(IlIIlIIIlll, IIIIIlIllI: Player) -> Action:
        if len(IlIIlIIIlll.history) < 2:
            return llIllIIlIlIlI
        elif 2 <= len(IlIIlIIIlll.history) <= 6:
            return IIIIIlIllI.history[-1]
        else:
            lIIIlIIlIIIIllIl = IIIIIlIllI.history[-8:-1].count(lIIIIIIlIllIIl)
            if IlIIlIIIlll.history[-1] == llIllIIlIlIlI and lIIIlIIlIIIIllIl <= 2:
                return llIllIIlIlIlI
            if IlIIlIIIlll.history[-1] == lIIIIIIlIllIIl and lIIIlIIlIIIIllIl <= 1:
                return llIllIIlIlIlI
            return lIIIIIIlIllIIl