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