How to print what a instance is

The title says it all basically
i have tried this but itsnt really efficient

	local ReturnSet = function(Object)
		print(Object)
		if Object:IsA("BasePart") then
			return "INSTANCE"
		elseif Object:IsA("GuiObject") then
			return "UI"
		else
			return "DATA"
		end
	end

You can use the typeof() function. For example:

local thing = typeof(game.Workspace.Part)
print(thing) // Output: Instance

This Does work but i want it too say stuff like

Attachment
Motor6D
etc

In that case, use the ClassName property.
Every instance has this property, which tells you exactly what it is. For example:

local partClass = game.Workspace.Part.ClassName
print(partClass) // Output: Part