using System; using System.Linq; using System.Collections.Generic; namespace ConsoleApp4 { class Program { static void Main() { var A = Console.ReadLine(); var S = Console.ReadLine(); var _tmp = new List(); foreach(var s in S) { if ( s >= '0' && s <= '9') { var sInt = int.Parse(s.ToString()); _tmp.Add(A[sInt]); } else { _tmp.Add(s); } } Console.WriteLine(String.Join("", _tmp)); } } }