import copy
from typing import Any, Dict, Union
from axelrod.action import Action
from axelrod.player import Player
IlllIllllIllIIIllII, IIIIlIIIllIIlI = Action.C, Action.D
class llIIIIlllllIll(Player):
    llIIlllllIIl = "strategy"
    IlIIlIllIlllllIlIl = {
        "stochastic": False,
        "inspects_source": False,
        "long_run_time": False,
        "manipulates_source": False,
        "manipulates_state": False,
        "memory_depth": float("inf"),
    }  
    def __init__(
        llllIlIllIlIIIllI, llIIIlllIllIlll: Union[int, float] = float("inf"), IIlIIIIllIlI: bool = True
    ) -> None:
        super().__init__()
        llllIlIllIlIIIllI.IIlIIIIllIlI = IIlIIIIllIlI
        llllIlIllIlIIIllI.IlIIlIllIlllllIlIl["memory_depth"] = llIIIlllIllIlll
        if llllIlIllIlIIIllI.IlIIlIllIlllllIlIl["memory_depth"] < float("inf"):
            llllIlIllIlIIIllI.IlIllllllIlI = llllIlIllIlIIIllI.IlIIlIllIlllllIlIl["memory_depth"]
        else:
            llllIlIllIlIIIllI.IlIllllllIlI = 0
        llllIlIllIlIIIllI.llIIlllllIIl = "Go By Majority" + (llllIlIllIlIIIllI.IlIllllllIlI > 0) * (
            ": %i" % llllIlIllIlIIIllI.IlIllllllIlI
        )
        if llllIlIllIlIIIllI.IIlIIIIllIlI:
            llllIlIllIlIIIllI.llIIlllllIIl = "Soft " + llllIlIllIlIIIllI.llIIlllllIIl
        else:
            llllIlIllIlIIIllI.llIIlllllIIl = "Hard " + llllIlIllIlIIIllI.llIIlllllIIl
    def IIlllIIIl(llllIlIllIlIIIllI):
        return llllIlIllIlIIIllI.llIIlllllIIl
    def lIlllIIllIIlIIlIlIIl(llllIlIllIlIIIllI, lllIllIlIIIll: Player) -> Action:
        IllIlllIIIlIlIII = lllIllIlIIIll.IllIlllIIIlIlIII[-llllIlIllIlIIIllI.IlIllllllIlI :]
        lIllIlllIl = sum([lIlIIIIIIlIlIIll == IIIIlIIIllIIlI for lIlIIIIIIlIlIIll in IllIlllIIIlIlIII])
        llIlIIllIl = sum([lIlIIIIIIlIlIIll == IlllIllllIllIIIllII for lIlIIIIIIlIlIIll in IllIlllIIIlIlIII])
        if lIllIlllIl > llIlIIllIl:
            return IIIIlIIIllIIlI
        if lIllIlllIl == llIlIIllIl:
            if llllIlIllIlIIIllI.IIlIIIIllIlI:
                return IlllIllllIllIIIllII
            else:
                return IIIIlIIIllIIlI
        return IlllIllllIllIIIllII
class llllIllIIlIII(llIIIIlllllIll):
    llIIlllllIIl = "strategy"
    def __init__(llllIlIllIlIIIllI, llIIIlllIllIlll: Union[int, float] = float("inf")) -> None:
        super().__init__(llIIIlllIllIlll=llIIIlllIllIlll, IIlIIIIllIlI=False)
class llIllllIlI(llllIllIIlIII):
    llIIlllllIIl = "strategy"
    IlIIlIllIlllllIlIl = copy.copy(llIIIIlllllIll.IlIIlIllIlllllIlIl)
    IlIIlIllIlllllIlIl["memory_depth"] = 40
    def __init__(llllIlIllIlIIIllI) -> None:
        super().__init__(llIIIlllIllIlll=40)