#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));
    newNode->data=data;
    newNode->next=NULL;
    return newNode;
}
int findMiddle(Node* head){
    Node* slow=head;
    Node* fast=head;
    if(head!=NULL){
        while(fast!=NULL&&fast->next!=NULL){
            slow=slow->next;
            fast=fast->next->next;
        }
    }
    return slow->data;
}
int main(){
    int n;
    scanf("%d",&n);
    if(n<0){
        printf("Invalid input\n");
        return 0;
    }
    Node* head=NULL;
    node* current=NULL;
    fir(int i=0;i<n;i++){
        int data;
        scanf("%d",&data);
        if(head==NULL){
            head=createNode(data);
            current=head;
        }
    }
    if(n>0){
        printf("%d\n",findMiddle(head));
    }
    return 0;
}