


import itertools
import string
from collections.abc import Generator, Iterable






def 	__lowerCAmelCase   (SCREAMING_SNAKE_CASE , SCREAMING_SNAKE_CASE )->  Generator[tuple[str, ...], None, None]:




      """simple docstring"""

      snake_case_	=				iter(SCREAMING_SNAKE_CASE )
      while True:
            snake_case_	=				tuple(itertools.islice(SCREAMING_SNAKE_CASE , SCREAMING_SNAKE_CASE ) )
            if not chunk:
                  return
            yield chunk






def 	__lowerCAmelCase   (SCREAMING_SNAKE_CASE )->  str:




      """simple docstring"""

      snake_case_	=				''''''.join([c.upper() for c in dirty if c in string.ascii_letters] )
      snake_case_	=				''''''

      if len(SCREAMING_SNAKE_CASE ) < 2:
            return dirty

      for i in range(len(SCREAMING_SNAKE_CASE ) - 1 ):
            clean += dirty[i]

            if dirty[i] == dirty[i + 1]:
                  clean += "X"

      clean += dirty[-1]

      if len(SCREAMING_SNAKE_CASE ) & 1:
            clean += "X"

      return clean






def 	__lowerCAmelCase   (SCREAMING_SNAKE_CASE )->  list[str]:




      """simple docstring"""

      snake_case_	=				'''ABCDEFGHIKLMNOPQRSTUVWXYZ'''
      # we're using a list instead of a '2d' array because it makes the math
      # for setting up the table and doing the actual encoding/decoding simpler
      snake_case_	=				[]

      # copy key chars into the table if they are in `alphabet` ignoring duplicates
      for char in key.upper():
            if char not in table and char in alphabet:
                  table.append(SCREAMING_SNAKE_CASE )

    # fill the rest of the table in with the remaining alphabet chars
      for char in alphabet:
            if char not in table:
                  table.append(SCREAMING_SNAKE_CASE )

      return table






def 	__lowerCAmelCase   (SCREAMING_SNAKE_CASE , SCREAMING_SNAKE_CASE )->  str:




      """simple docstring"""

      snake_case_	=				generate_table(SCREAMING_SNAKE_CASE )
      snake_case_	=				prepare_input(SCREAMING_SNAKE_CASE )
      snake_case_	=				''''''

      # https://en.wikipedia.org/wiki/Playfair_cipher#Description
      for chara, chara in chunker(SCREAMING_SNAKE_CASE , 2 ):
            snake_case_	,   snake_case_	=				divmod(table.index(SCREAMING_SNAKE_CASE ) , 5 )
            snake_case_	,   snake_case_	=				divmod(table.index(SCREAMING_SNAKE_CASE ) , 5 )

            if rowa == rowa:
                  ciphertext += table[rowa * 5 + (cola + 1) % 5]
                  ciphertext += table[rowa * 5 + (cola + 1) % 5]
            elif cola == cola:
                  ciphertext += table[((rowa + 1) % 5) * 5 + cola]
                  ciphertext += table[((rowa + 1) % 5) * 5 + cola]
            else:  # rectangle
                  ciphertext += table[rowa * 5 + cola]
                  ciphertext += table[rowa * 5 + cola]

      return ciphertext






def 	__lowerCAmelCase   (SCREAMING_SNAKE_CASE , SCREAMING_SNAKE_CASE )->  str:




      """simple docstring"""

      snake_case_	=				generate_table(SCREAMING_SNAKE_CASE )
      snake_case_	=				''''''

      # https://en.wikipedia.org/wiki/Playfair_cipher#Description
      for chara, chara in chunker(SCREAMING_SNAKE_CASE , 2 ):
            snake_case_	,   snake_case_	=				divmod(table.index(SCREAMING_SNAKE_CASE ) , 5 )
            snake_case_	,   snake_case_	=				divmod(table.index(SCREAMING_SNAKE_CASE ) , 5 )

            if rowa == rowa:
                  plaintext += table[rowa * 5 + (cola - 1) % 5]
                  plaintext += table[rowa * 5 + (cola - 1) % 5]
            elif cola == cola:
                  plaintext += table[((rowa - 1) % 5) * 5 + cola]
                  plaintext += table[((rowa - 1) % 5) * 5 + cola]
            else:  # rectangle
                  plaintext += table[rowa * 5 + cola]
                  plaintext += table[rowa * 5 + cola]

      return plaintext



# Function to print upper half of diamond (pyramid)






def 	__lowerCAmelCase   (SCREAMING_SNAKE_CASE )->  Dict:




      """simple docstring"""

      for i in range(0 , SCREAMING_SNAKE_CASE ):
            for _ in range(0 , n - i - 1 ):  # printing spaces
                  print(''' ''' , end='''''' )
            for _ in range(0 , i + 1 ):  # printing stars
                  print('''* ''' , end='''''' )
            print()






def 	__lowerCAmelCase   (SCREAMING_SNAKE_CASE )->  Dict:




      """simple docstring"""

      for i in range(SCREAMING_SNAKE_CASE , 0 , -1 ):
            for _ in range(SCREAMING_SNAKE_CASE , 0 , -1 ):  # printing stars
                  print('''* ''' , end='''''' )
            print()
            for _ in range(n - i + 1 , 0 , -1 ):  # printing spaces
                  print(''' ''' , end='''''' )






def 	__lowerCAmelCase   (SCREAMING_SNAKE_CASE )->  Any:




      """simple docstring"""

      if n <= 0:
            print('''       ...       ....        nothing printing :(''' )
            return
      floyd(SCREAMING_SNAKE_CASE )  # upper half
      reverse_floyd(SCREAMING_SNAKE_CASE )  # lower half


if __name__ == "__main__":
   print(r"""| /\ | |- |  |-  |--| |\  /| |-""")
   print(r"""|/  \| |- |_ |_  |__| | \/ | |_""")
   UpperCAmelCase      =   1
   while K:
      UpperCAmelCase      =   int(input("""enter the number and , and see the magic : """))
      print()
      pretty_print(user_number)
      UpperCAmelCase      =   int(input("""press 0 to exit... and 1 to continue..."""))

   print("""Good Bye...""")