#include<iostream>
using namespace std;
int main()
{
int n,a[100],buf;
cin >> n;
for(int i = 0 ; i < n ; i++ ){
a[i] = 60 - rand() % 100;
cout << i+1 << " = " << a[i] << endl ;
}
for(int i=n-1;i>=0;i--)
if(a[i]<0){
buf=a[i];
for(int j = i ; j > 0 ; j--){
a[i]=a[i-1];
}
a[0]=buf;
}
cout << " Конечный массив :" << endl ;
for(int i = 0 ; i < n ; i++ ){
cout<<a[i]<<' ';
}
return 0;
}