class Being
  def initialize(specialty=nil)
    @specialty=specialty
  end
  def to_s
    +.ljust(12)+to_s4Being+(@specialty? +*12+@specialty: )
  end
  def to_s4Being
    
  end
end

class Earthling < Being
  def to_s4Being
    +*12+to_s4Earthling
  end
end

class Mammal < Earthling
  def initialize(type)
    @type=type
  end
  def to_s4Earthling
    
  end
end

class Fish < Earthling
  def initialize(iq)
    @iq=(iq>1? :instrustableValue: iq)
  end
  def to_s4Earthling
    
  end
end

class Moonling < Being
  def to_s4Being
    
  end
end

diverseCollection=[]
diverseCollection << (marsian=Being.new())
diverseCollection << (me=Mammal.new(:human))
diverseCollection << (nemo=Fish.new(0.99))
diverseCollection << (jannakeMaan=Moonling.new)

puts 
diverseCollection.each do |being|
  puts ,being.to_s
end
puts 
puts +*50+


File.open('diverseCollection.bin','w') do |fo|
  fo << Marshal.dump(diverseCollection)
end


sameDiverseCollection=Marshal.load(File.read('diverseCollection.bin'))

puts 
puts(
     sameDiverseCollection.collect do |being|
       being.to_s
     end.join()
     )
puts