#include <stdio.h>
#include <stdlib.h>
#include <string.h>

// Node structure
struct Node {
    int data;
    struct Node* next;
};

// Function to create a new node
struct Node* createNode(int value) {
    struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
    newNode->data = value;
    newNode->next = NULL;
    return newNode;
}

// Function to print the circular list
void printList(struct Node* head, int n) {
    if (head == NULL) {
        printf("Invalid input\n");
        return;
    }

    struct Node* temp = head;
    for (int i = 0; i < n; i++) {
        printf("%d", temp->data);
        if (i != n - 1) printf(" ");
        temp = temp->next;
    }
    printf("\n");
}

int main() {
    int n;
    if (scanf("%d", &n) != 1 || n < 1 || n > 1000) {
        printf("Invalid input\n");
        return 0;
    }

    struct Node* head = NULL;
    struct Node* tail = NULL;

    for (int i = 0; i < n; i++) {
        int value;
        if (scanf("%d", &value) != 1) {
            printf("Invalid input\n");
            return 0;
        }

        struct Node* newNode = createNode(value);
        if (head == NULL) {
            head = tail = newNode;
        } else {
            tail->next = newNode;
            tail = newNode;
        }
    }

    // Make it circular
    tail->next = head;

    // Step 1: Find minimum
    int min = head->data;
    struct Node* current = head->next;
    while (current != head) {
        if (current->data < min) {
            min = current->data;
        }
        current = current->next;
    }

    // Step 2: Add min to all nodes
    current = head;
    for (int i = 0; i < n; i++) {
        current->data += min;
        current = current->next;
    }

    // Step 3: Print updated list
    printList(head, n);

    return 0;
}#include <stdio.h>
#include <stdlib.h>
#include <string.h>

// Node structure
struct Node {
    int data;
    struct Node* next;
};

// Function to create a new node
struct Node* createNode(int value) {
    struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
    newNode->data = value;
    newNode->next = NULL;
    return newNode;
}

// Function to print the circular list
void printList(struct Node* head, int n) {
    if (head == NULL) {
        printf("Invalid input\n");
        return;
    }

    struct Node* temp = head;
    for (int i = 0; i < n; i++) {
        printf("%d", temp->data);
        if (i != n - 1) printf(" ");
        temp = temp->next;
    }
    printf("\n");
}

int main() {
    int n;
    if (scanf("%d", &n) != 1 || n < 1 || n > 1000) {
        printf("Invalid input\n");
        return 0;
    }

    struct Node* head = NULL;
    struct Node* tail = NULL;

    for (int i = 0; i < n; i++) {
        int value;
        if (scanf("%d", &value) != 1) {
            printf("Invalid input\n");
            return 0;
        }

        struct Node* newNode = createNode(value);
        if (head == NULL) {
            head = tail = newNode;
        } else {
            tail->next = newNode;
            tail = newNode;
        }
    }

    // Make it circular
    tail->next = head;

    // Step 1: Find minimum
    int min = head->data;
    struct Node* current = head->next;
    while (current != head) {
        if (current->data < min) {
            min = current->data;
        }
        current = current->next;
    }

    // Step 2: Add min to all nodes
    current = head;
    for (int i = 0; i < n; i++) {
        current->data += min;
        current = current->next;
    }

    // Step 3: Print updated list
    printList(head, n);

    return 0;
}#include <stdio.h>
#include <stdlib.h>
#include <string.h>

// Node structure
struct Node {
    int data;
    struct Node* next;
};

// Function to create a new node
struct Node* createNode(int value) {
    struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
    newNode->data = value;
    newNode->next = NULL;
    return newNode;
}

// Function to print the circular list
void printList(struct Node* head, int n) {
    if (head == NULL) {
        printf("Invalid input\n");
        return;
    }

    struct Node* temp = head;
    for (int i = 0; i < n; i++) {
        printf("%d", temp->data);
        if (i != n - 1) printf(" ");
        temp = temp->next;
    }
    printf("\n");
}

int main() {
    int n;
    if (scanf("%d", &n) != 1 || n < 1 || n > 1000) {
        printf("Invalid input\n");
        return 0;
    }

    struct Node* head = NULL;
    struct Node* tail = NULL;

    for (int i = 0; i < n; i++) {
        int value;
        if (scanf("%d", &value) != 1) {
            printf("Invalid input\n");
            return 0;
        }

        struct Node* newNode = createNode(value);
        if (head == NULL) {
            head = tail = newNode;
        } else {
            tail->next = newNode;
            tail = newNode;
        }
    }

    // Make it circular
    tail->next = head;

    // Step 1: Find minimum
    int min = head->data;
    struct Node* current = head->next;
    while (current != head) {
        if (current->data < min) {
            min = current->data;
        }
        current = current->next;
    }

    // Step 2: Add min to all nodes
    current = head;
    for (int i = 0; i < n; i++) {
        current->data += min;
        current = current->next;
    }

    // Step 3: Print updated list
    printList(head, n);

    return 0;
}