h = (?A..?G).map {|c| [c, c+?#]}.to_h h['B']='C' h['E']='F' ch=gets.chomp puts h[ch]