# encoding: utf-8
table_cyr = "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя".split("")
table_lat = "ABVGDEЁŽZIJKLMNOPRSTUFHCČŠŚ'YJÈŲĄabvgdeёžzijklmnoprstufhcčšś'yjèųą".split("")
dict = Hash.new { |hash, key| hash[key] = key }
table_cyr.each_with_index do |i, idx|
dict[table_cyr[idx]] = dict[table_lat[idx]]
end
def conv(dict, s)
s.split("").map {|c| dict[c] }.join("")
end
text = "Дьяк. Дальнейших поводов для обсуждения не вижу."
print conv(dict, text)
IyBlbmNvZGluZzogdXRmLTgKCnRhYmxlX2N5ciA9ICLQkNCR0JLQk9CU0JXQgdCW0JfQmNCZ0JrQm9Cc0J3QntCf0KDQodCi0KPQpNCl0KbQp9Co0KnQqtCr0KzQrdCu0K/QsNCx0LLQs9C00LXRkdC20LfQuNC50LrQu9C80L3QvtC/0YDRgdGC0YPRhNGF0YbRh9GI0YnRitGL0YzRjdGO0Y8iLnNwbGl0KCIiKQp0YWJsZV9sYXQgPSAiQUJWR0RF0IHFvVpJSktMTU5PUFJTVFVGSEPEjMWgxZonWUrDiMWyxIRhYnZnZGXRkcW+emlqa2xtbm9wcnN0dWZoY8SNxaHFmyd5asOoxbPEhSIuc3BsaXQoIiIpCgpkaWN0ID0gSGFzaC5uZXcgeyB8aGFzaCwga2V5fCBoYXNoW2tleV0gPSBrZXkgfQoKdGFibGVfY3lyLmVhY2hfd2l0aF9pbmRleCBkbyB8aSwgaWR4fAogICAgZGljdFt0YWJsZV9jeXJbaWR4XV0gPSBkaWN0W3RhYmxlX2xhdFtpZHhdXQkKZW5kCgpkZWYgY29udihkaWN0LCBzKQogICAgcy5zcGxpdCgiIikubWFwIHt8Y3wgZGljdFtjXSB9LmpvaW4oIiIpCmVuZAoKdGV4dCA9ICLQlNGM0Y/Qui4g0JTQsNC70YzQvdC10LnRiNC40YUg0L/QvtCy0L7QtNC+0LIg0LTQu9GPINC+0LHRgdGD0LbQtNC10L3QuNGPINC90LUg0LLQuNC20YMuIgoKcHJpbnQgY29udihkaWN0LCB0ZXh0KQ==