Multiple layers nested has_many through

I’ve seen previous posts finding ways to do multiple has_many :through
assocations like the following

class A < ActiveRecord::Base

end