using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;


public class BrickMystery
{
	public string[] createPattern(string message)
	{
		char z = (char)0;
		string[] ret = new string[message.Length + 2];
		for (int i = 0; i < message.Length; i++)
		{
			char[] t = new char[]{'.','.','.','.','.','.','.'};
			int ch = message[i] - z;
			int j = 6;
			while (ch > 0)
			{
				t[j] = ((ch & 1) == 1 ? 'x' : '.');
				ch = ch >> 1;
				j--;
			}
			ret[i + 1] = 'x' + new string(t) + 'x';
		}
		ret[0] = ret[ret.Length - 1] = "x.......x";
		return ret;
	}

	// BEGIN KAWIGIEDIT TESTING
	// Generated by KawigiEdit 2.1.4 (beta) modified by pivanof
	#region Testing code generated by KawigiEdit
	[STAThread]
	private static Boolean KawigiEdit_RunTest(int testNum, string p0, Boolean hasAnswer, string[] p1) {
		Console.Write("Test " + testNum + ": [" + "\"" + p0 + "\"");
		Console.WriteLine("]");
		BrickMystery obj;
		string[] answer;
		obj = new BrickMystery();
		DateTime startTime = DateTime.Now;
		answer = obj.createPattern(p0);
		DateTime endTime = DateTime.Now;
		Boolean res;
		res = true;
		Console.WriteLine("Time: " + (endTime - startTime).TotalSeconds + " seconds");
		if (hasAnswer) {
			Console.WriteLine("Desired answer:");
			Console.Write("\t" + "{");
			for (int i = 0; p1.Length > i; ++i) {
				if (i > 0) {
					Console.Write(",");
				}
				Console.Write("\"" + p1[i] + "\"");
			}
			Console.WriteLine("}");
		}
		Console.WriteLine("Your answer:");
		Console.Write("\t" + "{");
		for (int i = 0; answer.Length > i; ++i) {
			if (i > 0) {
				Console.Write(",");
			}
			Console.Write("\"" + answer[i] + "\"");
		}
		Console.WriteLine("}");
		if (hasAnswer) {
			if (answer.Length != p1.Length) {
				res = false;
			} else {
				for (int i = 0; answer.Length > i; ++i) {
					if (answer[i] != p1[i]) {
						res = false;
					}
				}
			}
		}
		if (!res) {
			Console.WriteLine("DOESN'T MATCH!!!!");
		} else if ((endTime - startTime).TotalSeconds >= 2) {
			Console.WriteLine("FAIL the timeout");
			res = false;
		} else if (hasAnswer) {
			Console.WriteLine("Match :-)");
		} else {
			Console.WriteLine("OK, but is it right?");
		}
		Console.WriteLine("");
		return res;
	}
	public static void m1(string[] args) {
		Boolean all_right;
		all_right = true;
		
		string p0;
		string[] p1;
		
		// ----- test 0 -----
		p0 = "L";
		p1 = new string[]{"x.......x","xx..xx..x","x.......x"};
		all_right = KawigiEdit_RunTest(0, p0, true, p1) && all_right;
		// ------------------
		
		// ----- test 1 -----
		p0 = "P=NP?";
		p1 = new string[]{"x.......x","xx.x....x","x.xxxx.xx","xx..xxx.x","xx.x....x","x.xxxxxxx","x.......x"};
		all_right = KawigiEdit_RunTest(1, p0, true, p1) && all_right;
		// ------------------
		
		// ----- test 2 -----
		p0 = "";
		p1 = new string[]{"x.......x","x.......x"};
		all_right = KawigiEdit_RunTest(2, p0, true, p1) && all_right;
		// ------------------
		
		if (all_right) {
			Console.WriteLine("You're a stud (at least on the example cases)!");
		} else {
			Console.WriteLine("Some of the test cases had errors.");
		}
		Console.ReadKey();
	}
	#endregion
	// END KAWIGIEDIT TESTING
}
//Powered by KawigiEdit 2.1.4 (beta) modified by pivanof!
