using System;
using System.Text.RegularExpressions;
public class Program
{
public static void Main()
string str = "9833772211";
string result = Regex.Replace(str, @"(?<=\d{2})\d(?=\d{2})", "X");
Console.WriteLine(result);
}