#include<stdio.h>
#define MAXLINE 1000

int max;
char line[MAXLINE];
char longuest[MAXLINE];

int getLine(void);
void copy(void);

int main(){
  int len;
  max = 0;
  while((len = getLine()) > 0)
    if(len > max){
      max = len;
      copy();
    }
  if(max > 0)
    printf("%s", longuest);
  return 0;
}

int getLine(void){
  int c, i;

  for(i=0; i<MAXLINE-1
      && (c=getchar()) != EOF
      && c != '\n'; ++i)
    line[i] = c;
  if(c == '\n'){
    line[i] = c;
    ++i;
  }
  line[i] = '\0';
  return i;
}

void copy(void){
  int i;
  i = 0;
  while((longuest[i] = line[i]) != '\0')
    ++i;
}
