public static void Main()
int width = int.Parse(Console.ReadLine());
string[,] matrix = new string[height, width];
for (int row = 0; row < height; row++)
int number = int.Parse(Console.ReadLine());
for (int col = width - 1; col >= 0; col--)
int lastBit = number & (1 << position);
input = Console.ReadLine();
int row = int.Parse(Console.ReadLine());
int col = int.Parse(Console.ReadLine());
for (int currCol = col; currCol < width; currCol++)
if (matrix[row, currCol] == "1")
matrix[row, currCol] = "0";
for (int currCol = width - 1; onesCount > 0; onesCount--, currCol--)
matrix[row, currCol] = "1";
else if (input == "left")
int row = int.Parse(Console.ReadLine());
int col = int.Parse(Console.ReadLine());
for (int currCol = col; currCol >= 0; currCol--)
if (matrix[row, currCol] == "1")
matrix[row, currCol] = "0";
for (int currCol = 0; onesCount > 0; onesCount--, currCol++)
matrix[row, currCol] = "1";
else if (input == "reset")
for (int row = 0; row < height; row++)
for (int currCol = 0; currCol < width; currCol++)
if (matrix[row, currCol] == "1")
matrix[row, currCol] = "0";
for (int currCol = 0; onesCount > 0; onesCount--, currCol++)
matrix[row, currCol] = "1";
for (int row = 0; row < matrix.GetLength(0); row++)
for (int col = 0; col < matrix.GetLength(1); col++)
binNum += matrix[row, col];
for (int i = binNum.Length - 1; i >= 0; i--)
decimalNum += (long)(digit * (Math.Pow(2, pow)));
int zeroColumnCounter = 0;
for (int col = width - 1; col >= 0; col--)
for (int row = 0; row < height; row++)
if (matrix[row, col] == "0")
if (zeroesCounter == height)
Console.WriteLine(result * zeroColumnCounter);