#include
using namespace std;
void bubble_sort(int a[], int n){
if (n==1){
return;
}
for (int j = 0; j < n-1; j++){
if (a[j] > a[j+1]){
swap(a[j], a[j+1]);
}
}
bubble_sort(a, n-1);
}
void bubble_sort_completely_recurrsively(int a[], int j, int n){
if (n==1){
return;
}
if (j==n - 1){
return bubble_sort_completely_recurrsively(a, 0, n-1);
}
if (a[j] > a[j+1]){
swap(a[j], a[j+1]);
}
bubble_sort_completely_recurrsively(a, j+1, n);
return;
}
int main(){
int n;
int a[n];
for (int i = 0; i < n; i++){
cin >> a[i];
}
for (int i = 0; i < n; i++){
cout << a[i] << " " << endl;
}
cout << bubble_sort(a, n) << endl;
cout << bubble_sort_completely_recurrsively(a, 0, n);
return 0;
}