url = gets.chomp.to_s
qa = `curl -Is #{url} |head -n1 | grep -Eo '[0-9]{3,3}'`.to_i
case qa
when 200..299 then puts 'OK'
when 300..399 then puts 'Redirect'
when 400..499 then puts 'Client Error'
when 500..599 then puts 'Server Error'
else
if qa != 0-9 || qa <= 600 || 199 <= qa
puts 'Timeout'
else
puts 'Unknown error occurred'
end
end