#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 0;
    struct Node*temp=head;
    while(temp->next!=NULL)
      temp=temp->next;
    temp->next=newNode;
    return head;
}
int findMidle(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("Invalid input");
        return 0;
    }
    struct 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;
}