#include<stdio.h>
#include<stdlib.h>

typedef struct doubly
{
    int data;
    struct doubly *prev,*next;
}node;

node *head=NULL,tail;

void create(int n)
{
    node *nd=(node*)malloc(sizeof(node));
    nd->data=n;
    nd->prev=nd->next=NULL;
    
    if(head==NULL)
    {
        head=tail=nd;
    }
    else
    {
        nd->prev=tail;
        tail->next=nd;
        tail=nd;
    }
    tail->next=head;
    head->prev=tail;
}

void print()
{
    node*temp=head;
    int greater=temp->data;
    temp=temp->next;
    while(temp!=head)
    {
        if(temp->data>greater)
        {
            greater=temp->data;
        }
        temp=temp->next;
    }
    printf("%d",greater);
}
int main()
{
    int n,data;
    scanf("%d",&n);
    if(n<=0)
    {
        print();
    }
}