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
IlIIIIlIIlllIlIllI, IIlIlIlIlIIIlllllI = Action.C, Action.D
class lllIllllIllIIII(Player):
    IIIIIllIllIIIl = "strategy"
    llIIlllIlIlI = {
        "memory_depth": float("inf"),
        "stochastic": True,
        "long_run_time": False,
        "inspects_source": False,
        "manipulates_source": False,
        "manipulates_state": False,
    }
    def llIIIllIlIlIII(IlIIIlIlIIIIIIlllllI, lIllIIIllllII: Player) -> Action:
        if len(IlIIIlIlIIIIIIlllllI.history) <= 1:
            return IlIIIIlIIlllIlIllI
        IllIIIIlI = lIllIIIllllII.defections
        if lIllIIIllllII.history[0] == IIlIlIlIlIIIlllllI:
            IllIIIIlI -= 1
        if IllIIIIlI in [4, 7, 9]:
            return IIlIlIlIlIIIlllllI
        if IllIIIIlI > 9 and lIllIIIllllII.history[-1] == IIlIlIlIlIIIlllllI:
            return IlIIIlIlIIIIIIlllllI._random.random_choice((0.5) ** (IllIIIIlI - 9))
        return IlIIIIlIIlllIlIllI