require 'prime' a,b=gets.split(" ").map{|e| e.to_i} c=a.gcd(b) c2=c ans=[] while c%2==0 && c>0 do ans<<2 c/=2 end if (c.prime?)==false then q=3 while q*q<=c do hit=false while c>0 && c%q==0 do hit=true ans<