S = gets.chomp S.chars.tally.each do |c, count| next unless count == 1 puts "#{S.index(c) + 1} #{c}" break end