A = gets.to_i B = gets.to_i a = Rational(A, 5_000).to_f b = Rational(B, 200_000).to_f if (a - b).abs <= 1.0 puts 1 else puts 2 end