output_description: The output consists of 2 lines.
  
  In the first line, please print the sorted sequence. Two contiguous elements
  of the sequence should be separated by a space character.
  
  In the second line, please print the number of swap operations.
input_description: The first line of the input includes an integer _N_ , the number of elements
  in the sequence.
  
  In the second line, _N_ elements of the sequence are given separated by spaces
  characters.
attempt: n = int(input())
  t = list(map(int, input().split(" ")))
  x, y = 0, 0
  while True:
      x = 0
      for i in range(n - 1):
          if t[i] > t[i + 1]:
              t[i], t[i + 1] = t[i + 1], t[i]
              y = y + 1
          else:
              x = x + 1
      if x == n - 1:
          break
  print(" ".join(map(str, t)))
  print(y)
  
problem_description: Bubble Sort
  
  Write a program of the Bubble Sort algorithm which sorts a sequence _A_ in
  ascending order. The algorithm should be based on the following pseudocode:
  
      
      
      BubbleSort(A)
      1 for i = 0 to A.length-1
      2     for j = A.length-1 downto i+1
      3         if A[j] < A[j-1]
      4             swap A[j] and A[j-1]
      
  
  Note that, indices for array elements are based on 0-origin.
  
  Your program should also print the number of swap operations defined in line 4
  of the pseudocode.
samples: [{"input": "5\n    5 3 2 4 1", "output": "1 2 3 4 5\n    8"}, {"input": "6\n    5 2 4 6 1 3", "output": "1 2 3 4 5 6\n    9"}]