A = 'abcdefghijklmnopqrstuvwxyz' B = gets.chomp j = 26.times.find{|i| A[i] != B[i] } puts "#{A[j]}to#{B[j]}"