local p = {}

function p.main(frame)
	local ret = frame:getParent().args[1] or ''
	local i = {}
	for var in string.gmatch(ret, '%$%d+') do
		i[var] = (i[var] or 0) + 1
		ret = string.gsub(ret, var, i[var], 1)
	end
	return ret
end

return p