#include<stdio.h>
int main(){
unsigned int arr_sz;
scanf("%u",&arr_sz);
signed long long int arr[arr_sz];
unsigned int arr_ism=0;
for(unsigned int i=0;i<arr_sz;i++){
scanf("%lld",&arr[i]);
if(arr[i]<arr[arr_ism])
arr_ism=i;
}
for(unsigned int i=0;i<arr_sz;i++)
printf("%lld ",arr[i]<0?arr[i]:arr[arr_ism]);
printf("\n");
//getchar();
return 0;
#include<stdio.h>
int main(){
unsigned int arr_sz;
scanf("%u",&arr_sz);
signed long long int arr[arr_sz];
unsigned int arr_ism=0;
for(unsigned int i=0;i<arr_sz;i++){
scanf("%lld",&arr[i]);
if(arr[i]<arr[arr_ism])
arr_ism=i;
}
for(unsigned int i=0;i<arr_sz;i++)
printf("%lld ",arr[i]<0?arr[i]:arr[arr_ism]);
printf("\n");
//getchar();
return 0;
}