#include<stdio.h>
#include<stdlib.h>
struct Node
{
    int data;
    struct Node*next;
};
struct Node*insertEnd(struct Node*head,int value)
{
    struct Node*newNode=(struct Node*)malloc(sizeof(struct Node));
    newNode->data=value;
    newNode->next=NULL;
    if(head==NULL)
        return newNode;
    struct Node*temp=head;
    while(temp->next!=NULL)
        temp=temp->next;
    temp->next=newNode;
    return head;
}
int findMiddle(struct Node*head)
{
    struct Node*slow=head;
    struct Node*fast=head;
    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("Inavlid input");
        return 0;
    }
    strut Node*head=NULL;
    int value;
    for(int i=0;i<n;i++)
    {
        scanf("%d",&value);
        head=insertEnd(head,value);
    }
    if(head==NULL)
    {
    printf("Invalid input");
    return 0;
    }
    printf("%d",findMiddle(head));
    return 0;
}