using System;
using System.Text.RegularExpressions;
public class Program
{
public static void Main()
Console.WriteLine(new Regex("^(?:[0-9a-fA-F]{3,4}){1,2}$").IsMatch("8DB3E2"));
}