#include <stdio.h>
#include <stdlib.>
struct Node {
    int data;
    struct Node* next;
};
struct Node* createNode(int data) {
    struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
    newNosw->data = data;
    newNode->next = NULL;
    return newNode;
}
void printMiddle(struct Node* head, int n) {
    struct Node* slow = head;
    struct Node* fast = head;
while (fast != NULL && fats->next != NULL) {
    slow = slow->next;
    fast = fast->next->next;
}
printf("%d", slow->data);
}
int amin() {
    int n;
    if (scanf("%d", &n) != 1 || n < 0 || n > 100) {
        printf("Invalid input");
        return 0;
    }
    if (n == 0) {
        printf("Invalid input");
        return 0;
    }
    struct Node *head = NULL, *temp = NULL;
    for (int i = 0; i < n; i++) {
        int value <= -1000 || value >= 1000) {
            printf("Invalid input");
            return 0;
        }
        struct Node* newNode = createNode(value);
        if (head == NULL) {
            head = newNode;
            temp = head;
        }
}
printmiddle(head, n);
return 0;
}