//circles.cpp
//pgmr: T Feil
// Circles problem for 2002 East Central ACM Regional Pgm Contest

#include <iostream.h>
#include <string.h>
#include <math.h>

char val[156], A[157];
double x[156], y[156];
int len, pos[156];

void FillTables(){
  double S=sqrt(3);
  int i, j, k, xval;

  x[0]=y[0]=0;
  k=1;
  for(i=1;i<13;i++){   //do row i of circles
    xval=-1*i;
    for(j=0;j<=i;j++){  //fill i+1 slots (for row i circles)
      y[k]=i*S;
      x[k]=xval;
      xval += 2;
      k++;
    }
  }
}

void SortEm(int n){
  int i,j;
  char key;

  for(i=1;i<n;i++){
    key=val[i];
    j=i-1;
    while(j>=0 && val[j]>key){
      val[j+1]=val[j];
      pos[j+1]=pos[j];
      j--;
    }
    val[j+1]=key;
    pos[j+1]=i;
  }
}

double Square(double x){
  return x*x;
}

double abs(double x){
  if(x<0) return -1*x;
  else    return x;
}

void MoveUp(int &i){
  char key=val[i];
  while(i<len && val[i]==key) i++;
}

int Count(int i){
  char key=val[i];
  int count =1;

  i++;
  while(i<len && val[i]==key){
    count++; i++;
  }
//cout<<key<<' '<<count<<endl;
  return count;
}

int Triangle(int i){
  int p1=pos[i], p2=pos[i+1], p3=pos[i+2];
  double d1, d2, d3, epsilon=0.01;

  d1=sqrt(Square(x[p1]-x[p2])+Square(y[p1]-y[p2]));
  d2=sqrt(Square(x[p1]-x[p3])+Square(y[p1]-y[p3]));
  d3=sqrt(Square(x[p3]-x[p2])+Square(y[p3]-y[p2]));

  if((abs(d1-d2)<epsilon) && (abs(d1-d3)<epsilon))
    return 1;
  else
    return 0;
} 


int main(){
  int i,n,found;

  FillTables();
  cin>>n;
  while(n>0){
    //getdata
    cin>>A; 
    len=strlen(A);
    for(i=0;i<len;i++){
      val[i]=A[i];
      pos[i]=i;
    }

//cout<<A<<endl;

    SortEm(len);

/*cout<<"Sorted finished"<<endl;
for(i=0;i<len;i++)
  cout<<val[i];
cout<<endl;
for(i=0;i<len;i++)
  cout<<pos[i];
cout<<endl;
*/

   //main stuff
   i=0; found=0;
   while(i<len){
     if(Count(i)==3)
       if(Triangle(i)){
         cout<<val[i];
         found=1;
       }
     MoveUp(i);
   }
   if(!found) cout<<"LOOOOOOOOSER!";
   cout<<endl;

  cin>>n;
  }
  return 0;
}

  
