Is there possible to find parent module in nested module?

Hi, I have this nested module:

defmodule AA do
  defmodule BB do
    defmodule CC do
      ...
    end
  end
end

now is there a way get all the parents reversely?

For example:

[AA.BB.CC, AA.BB, AA]

It should noted, maybe the user named a module like Testy.AA, I just need to explore nested module, I mean module inside the other module. and I have always the last one module name, AA.BB.CC

Thank you