



'''simple docstring'''



def        UpperCAmelCase (    A	:					str       ,		A	:					Dict					):
							SCREAMING_SNAKE_CASE       :   list[list[str]]         =      [[] for _ in range(_a					)]
							SCREAMING_SNAKE_CASE       :   Optional[Any]         =      key - 1

							if key <= 0:
														raise ValueError('''Height of grid can\'t be 0 or negative'''					)
							if key == 1 or len(_a					) <= key:
														return input_string

							for position, character in enumerate(_a					):
														SCREAMING_SNAKE_CASE       :   Tuple         =      position % (lowest * 2)  # puts it in bounds
														SCREAMING_SNAKE_CASE       :   str         =      min(_a       ,		lowest * 2 - num					)  # creates zigzag pattern
														temp_grid[num].append(_a					)
							SCREAMING_SNAKE_CASE       :   Optional[int]         =      ["".join(_a					) for row in temp_grid]
							SCREAMING_SNAKE_CASE       :   Union[str, Any]         =      "".join(_a					)

							return output_string
def        UpperCAmelCase (    A	:					List[Any]       ,		A	:					List[str]					):
							SCREAMING_SNAKE_CASE       :   Optional[int]         =      []
							SCREAMING_SNAKE_CASE       :   int         =      key - 1

							if key <= 0:
														raise ValueError('''Height of grid can\'t be 0 or negative'''					)
							if key == 1:
														return input_string

							SCREAMING_SNAKE_CASE       :   list[list[str]]         =      [[] for _ in range(_a					)]  # generates template
							for position in range(len(_a					)					):
														SCREAMING_SNAKE_CASE       :   Dict         =      position % (lowest * 2)  # puts it in bounds
														SCREAMING_SNAKE_CASE       :   int         =      min(_a       ,		lowest * 2 - num					)  # creates zigzag pattern
														temp_grid[num].append('''*'''					)

							SCREAMING_SNAKE_CASE       :   Any         =      0
							for row in temp_grid:  # fills in the characters
														SCREAMING_SNAKE_CASE       :   Tuple         =      input_string[counter : counter + len(_a					)]
														grid.append(list(_a					)					)
														counter += len(_a					)

							SCREAMING_SNAKE_CASE       :   Optional[int]         =      ""  # reads as zigzag
							for position in range(len(_a					)					):
														SCREAMING_SNAKE_CASE       :   int         =      position % (lowest * 2)  # puts it in bounds
														SCREAMING_SNAKE_CASE       :   Union[str, Any]         =      min(_a       ,		lowest * 2 - num					)  # creates zigzag pattern
														output_string += grid[num][0]
														grid[num].pop(0					)
							return output_string
def        UpperCAmelCase (    A	:					List[Any]					):
							SCREAMING_SNAKE_CASE       :   List[str]         =      {}
							for key_guess in range(1       ,		len(_a					)					):  # tries every key
														SCREAMING_SNAKE_CASE       :   Tuple         =      decrypt(_a       ,		_a					)
							return results


if __name__ == "__main__":
							import doctest

							doctest.testmod()







def 			lowerCamelCase__			(       _a				,      _a):
	SCREAMING_SNAKE_CASE :   Optional[int]					  =							0
	while b > 0:
		if b & 1:
			res += a

		a += a
		b >>= 1

	return res

def 			lowerCamelCase__			(       _a				,      _a				,      _a):
	SCREAMING_SNAKE_CASE :   Optional[int]					  =							0
	while b > 0:
		if b & 1:
			SCREAMING_SNAKE_CASE :   Optional[Any]					  =							((res % c) + (a % c)) % c

		a += a
		b >>= 1

	return res