#include<stdio.h>
#include<stdlib.h>
typedef struct Node{
    int data;
    struct Node* next;
}Node;
Node* createNode(int data){
    Node* newNode =(Node*)malloc(sizeof(Node));
    if(!newNode){
        printf("Memory error\n");
        return NULL;
    }
    newNode->data = data;
    newNode->next = NULL;
    return newNode;
}
void findMiddle(Node* head, int n){
    if(n < 0){
        printf("Invalid input\n");
        return 1;
    }
    Node* slow = head;
    Node* fast = head;
    int count = 0;
    if(head != NULL){
        while(fast != NULL && fast->next != NULL){
            slow = slow->next;
            fast = fast->next->next;
            count += 2;
        }
    }
    if(count < n && n % 2 == 0 && fast != NULL){
        slow = slow->next;
    }
    if(n > 0){
        printf("%d\n", slow->data);
    }
}
Node* createLinkedList(int n){
    Node* head = NULL;
    Node* temp = NULL;
    int data;
    for(int i = 0; i < n;i++){
        scanf("%d", &data);
        Node* newNode = createNode(data);
        if(head){
            head = newNode;
            temp = head;
        }else{
            temp->next = newNode;
            temp = temp->next;
        }
}
return head;
}
int main(){
    int n;
    scanf("%d", &n);
    Node* head = createLinkedList(n);
    findMiddle(head, n);
    return 0;
}