# include<stdio.h>
# include<stdlib.h>
struct Node{
    int data;
    struct Node*next;
};
struct Node*insertEnd(struct Node*last,int value){
    struct Node*newNode = (struct node*)malloc(sizeof(structNode));
    if(!newNode){
        printf("Memory error\n");
        exit(0);
    }
    newNode->data = value;
    if(last == NULL){
        newNode->next = newNode;
        last = newNode;
    } else {
        newNode->next = last->next;
        last->next = newNode;
        last = newNode;
    }
    return last;
}
int findSmallest(struct Node*last){
    struct Node*temp = last->next;
    int smallest = temp->data;
}
void updateList(struct Node*last,int smallest){
    struct Node*temp=last->next;
    do{
        temp->data+=smallest;
        temp = temp->next;
    } while (temp!=last->next);
}
void printList(struct Node*last){
    if (last == NULL) return;
    struct Node*temp = last->next;
    do{
        printf("%d",temp->data);
        temp = temp->next;
    } while(temp!=last->next);
}
int main(){
    int n,value;
    if(scanf("%d",&n)!=1 || n<1 || n>1000){
        printf("Invalid input");
        rerturn 0;
    }
    struct Node*last=NULL;
    for(int i=0;i<n;i++){
        if(scanf("%d",&value)!=1){
            printf("Invalid input");
            return 0;
        }
        last = insertEnd(last,value);
    }
    int smallest = findSmallest(last);
    updateList(last,smallest);
    printList(last);
    return 0;
}
}