public static void Main()
const int numberOfLines = 16;
char[,] matrix = new char[16, 16];
char redCenterCapacitor = 'R';
char blueCenterCapacitor = 'B';
for (int row = 0; row < numberOfLines; row++)
string line = Console.ReadLine();
for (int col = 0; col < line.Length; col++)
matrix[row, col] = digit;
for (int row = 1; row < numberOfLines - 1; row++)
for (int col = 1; col < numberOfLines - 1; col++)
if (matrix[row, col] == '0')
matrix[row - 1, col - 1] == '1' &&
matrix[row - 1, col] == '1' &&
matrix[row - 1, col + 1] == '1' &&
matrix[row, col - 1] == '1' &&
matrix[row, col + 1] == '1' &&
matrix[row + 1, col - 1] == '1' &&
matrix[row + 1, col] == '1' &&
matrix[row + 1, col + 1] == '1'
if (capacitorParts == 8 && col < numberOfLines / 2)
matrix[row, col] = redCenterCapacitor;
else if (capacitorParts == 8 && col >= numberOfLines / 2)
matrix[row, col] = blueCenterCapacitor;
string command = Console.ReadLine();
int row = int.Parse(Console.ReadLine());
int col = int.Parse(Console.ReadLine());
if (matrix[row, col] == '1')
row = int.Parse(Console.ReadLine());
col = int.Parse(Console.ReadLine());
if (matrix[row, col] == '1')
Console.WriteLine("missed");
Console.WriteLine(redCapacitors + blueCapacitors);
Console.WriteLine("BOOM");
if (matrix[row, col] == 'R')
for (int i = row - 1; i <= row + 1; i++)
for (int j = col - 1; j <= col + 1; j++)
if (matrix[row, col] == 'B')
for (int i = row - 1; i <= row + 1; i++)
for (int j = col - 1; j <= col + 1; j++)
command = Console.ReadLine();
Console.WriteLine(blueCapacitors);
Console.WriteLine("disarmed");
Console.WriteLine(redCapacitors);
Console.WriteLine("BOOM");
Console.WriteLine(redCapacitors);
Console.WriteLine("disarmed");
Console.WriteLine(blueCapacitors);
Console.WriteLine("BOOM");