# frozen_string_literal: true def solve N.odd? == M.odd? ? [N, M].min : 1 end N, M = gets.chomp.split.map(&:to_i) puts solve