input: def generate_sierpinski_triangle(n: int):
      """ Generate the first n levels of the Sierpinski triangle.
      >>> generate_sierpinski_triangle(1)
      '1'
      >>> generate_sierpinski_triangle(2)
      '1\n1 1'
      >>> generate_sierpinski_triangle(3)
      '1\n1 1\n1 0 1'
      """
output:     if n == 1:
          return '1'
      
      result = ['1']
      current_row = [1]
      
      for i in range(1, n):
          next_row = [1]
          for j in range(1, i):
              next_row.append(current_row[j-1] ^ current_row[j])
          next_row.append(1)
          result.append(' '.join(map(str, next_row)))
          current_row = next_row
      
      return '\n'.join(result)