function c10105675.initial_effect(c)
	local e1=Effect.CreateEffect(c)
	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetRange(LOCATION_HAND)
	e1:SetCountLimit(1,10105675)
	e1:SetTarget(c10105675.sptg)
	e1:SetOperation(c10105675.spop)
	c:RegisterEffect(e1)
    local e2=Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetCode(EFFECT_XYZ_LEVEL)
	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e2:SetRange(LOCATION_MZONE)
	e2:SetValue(c10105675.xyzlv)
	e2:SetLabel(3)
	c:RegisterEffect(e2)
	local e3=e2:Clone()
	e3:SetLabel(4)
	c:RegisterEffect(e3)
    -- local e4=Effect.CreateEffect(c)
	-- e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
	-- e4:SetCode(EVENT_BE_MATERIAL)
	-- e4:SetCountLimit(1,101056750)
	-- e4:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
	-- e4:SetCondition(c10105675.efcon)
	-- e4:SetOperation(c10105675.efop)
	-- c:RegisterEffect(e4)
	local e5=Effect.CreateEffect(c)
	e5:SetType(EFFECT_TYPE_XMATERIAL)
	e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e5:SetRange(LOCATION_MZONE)
	e5:SetCode(EFFECT_IMMUNE_EFFECT)
	e5:SetCondition(c10105675.xmatcon)
	e5:SetValue(c10105675.efilter)
	c:RegisterEffect(e5)
end
function c10105675.tgfilter(c)
	return c:IsSetCard(0x1084) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c10105675.spfilter(c,e,tp)
	return c:IsSetCard(0x1084) and not c:IsPublic() and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and not c:IsLevel(2)
end
function c10105675.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
	local c=e:GetHandler()
	local g=Duel.GetMatchingGroup(c10105675.tgfilter,tp,LOCATION_DECK,0,nil)
	if chk==0 then return g:CheckSubGroup(aux.dncheck,2,2) and not Duel.IsPlayerAffectedByEffect(tp,59822133)
		and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
		and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
		and not c:IsPublic()
		and Duel.IsExistingMatchingCard(c10105675.spfilter,tp,LOCATION_HAND,0,1,c,e,tp) end
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
	local g=Duel.SelectMatchingCard(tp,c10105675.spfilter,tp,LOCATION_HAND,0,1,1,c,e,tp)
	local tc=g:GetFirst()
	Duel.ConfirmCards(1-tp,g)
	local e1=Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetCode(EFFECT_PUBLIC)
	e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
	c:RegisterEffect(e1)
	local e2=Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
	e2:SetCode(EVENT_CHAIN_SOLVED)
	e2:SetRange(LOCATION_HAND)
	e2:SetOperation(c10105675.clearop)
	e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
	e2:SetLabel(Duel.GetCurrentChain())
	e2:SetLabelObject(e1)
	c:RegisterEffect(e2)
	local e3=e1:Clone()
	tc:RegisterEffect(e3)
	local e4=e2:Clone()
	e4:SetLabelObject(e3)
	tc:RegisterEffect(e4)
	Duel.SetTargetCard(g)
	Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_DECK)
	Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND)
end
function c10105675.clearop(e,tp,eg,ep,ev,re,r,rp)
	if ev~=e:GetLabel() then return end
	e:GetLabelObject():Reset()
	e:Reset()
end
function c10105675.spop(e,tp,eg,ep,ev,re,r,rp)
	local c=e:GetHandler()
	local tc=Duel.GetFirstTarget()
	if not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
		and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e)
		and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) then
		Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
		Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
		Duel.SpecialSummonComplete()
		local g=Duel.GetMatchingGroup(c10105675.tgfilter,tp,LOCATION_DECK,0,nil)
		Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
		local sg=g:SelectSubGroup(tp,aux.dncheck,false,2,2)
		Duel.SendtoGrave(sg,REASON_EFFECT)
	end
	local e5=Effect.CreateEffect(c)
	e5:SetType(EFFECT_TYPE_FIELD)
	e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
	e5:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
	e5:SetTargetRange(1,0)
	e5:SetTarget(c10105675.splimit)
	e5:SetReset(RESET_PHASE+PHASE_END)
	Duel.RegisterEffect(e5,tp)
end
function c10105675.splimit(e,c)
	return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_XYZ) and not c:IsRace(RACE_WARRIOR)
end
function  c10105675.xyzlv(e,c,rc)
	if rc:IsSetCard(0x1084) then
		return c:GetLevel()+0x10000*e:GetLabel()
	else
		return c:GetLevel()
	end
end
function c10105675.xmatcon(e)
	return e:GetHandler():IsSetCard(0x1084) and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c10105675.efilter(e,re)
	return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
-- function c10105675.efcon(e,tp,eg,ep,ev,re,r,rp)
-- 	local c=e:GetHandler()
-- 	return r==REASON_XYZ and c:GetReasonCard():IsSetCard(0x1084)
-- end
-- function c10105675.efop(e,tp,eg,ep,ev,re,r,rp)
-- 	local c=e:GetHandler()
-- 	local rc=c:GetReasonCard()
-- 	local e1=Effect.CreateEffect(rc)
-- 	e1:SetDescription(aux.Stringid(10105675,1))
-- 	e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
-- 	e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
-- 	e1:SetProperty(EFFECT_FLAG_DELAY)
-- 	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
-- 	e1:SetTarget(c10105675.thtg)
-- 	e1:SetOperation(c10105675.thop)
-- 	e1:SetReset(RESET_EVENT+RESETS_STANDARD)
-- 	rc:RegisterEffect(e1,true)
-- 	if not rc:IsType(TYPE_EFFECT) then
-- 		local e2=Effect.CreateEffect(c)
-- 		e2:SetType(EFFECT_TYPE_SINGLE)
-- 		e2:SetCode(EFFECT_ADD_TYPE)
-- 		e2:SetValue(TYPE_EFFECT)
-- 		e2:SetReset(RESET_EVENT+RESETS_STANDARD)
-- 		rc:RegisterEffect(e2,true)
-- 	end
-- end
-- function c10105675.thfilter(c)
-- 	return c:IsSetCard(0x84) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
-- end
-- function c10105675.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
-- 	if chk==0 then return Duel.IsExistingMatchingCard(c10105675.thfilter,tp,LOCATION_DECK,0,1,nil) end
-- 	Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
-- 	Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
-- end
-- function c10105675.thop(e,tp,eg,ep,ev,re,r,rp)
-- 	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
-- 	local g=Duel.SelectMatchingCard(tp,c10105675.thfilter,tp,LOCATION_DECK,0,1,1,nil)
-- 	if g:GetCount()>0 then
-- 		Duel.SendtoHand(g,nil,REASON_EFFECT)
-- 		Duel.ConfirmCards(1-tp,g)
-- 	end
-- end