n=f=eval *$< f/=2while f&1<1 (3..n**0.5).any?{|i|n%i<1&&f=i} p f==3?3:n%4<1?4:f