using System; using System.Collections.Generic; using System.Linq; class Program { static string InputPattern = "InputX"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("2 8"); WillReturn.Add("..yiwiy9"); WillReturn.Add("9yiwiy.."); //..yiwiY9 //9Yiwiy.. } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static long[] GetSplitArr(string pStr) { return (pStr == "" ? new string[0] : pStr.Split(' ')).Select(pX => long.Parse(pX)).ToArray(); } static void Main() { List InputList = GetInputList(); //long[] wkArr = GetSplitArr(InputList[0]); foreach (string EachStr in InputList.Skip(1)) { string CurrStr = EachStr; CurrStr = CurrStr.Replace("yiwiy9", "yiwiY9"); CurrStr = CurrStr.Replace("9yiwiy", "9Yiwiy"); Console.WriteLine(CurrStr); } } }