 = 0;

    if ( (strcmp(str2, "Ukraine")) == 0 && (strcmp(str1, "Russia")) == 0 )
        flag = 0;

    return flag;
}

// Return Country and It cannot be changed

int whichPot(char * team, char *** result){
    int i,j,flag=0;
    for(i=0;i<4;i++){
        for(j=0;j<8;j++){
            char *str = result[i][j];
            if( (strcmp(team, str)) == 0 ){
                flag=1;
                break;
            }
        }
        if(flag==1)
            break;
    }

    return i+1;
}

int isGroupValid(char ** group, char *** result){
    int i,j;
    int flag = 1;
    for(i=0;i<3;i++){
        for(j=i+1;j<4;j++){
            char *str1 = group[i];
            char *str2 = group[j];
            if(!canTheyMeet(str1, str2) || whichPot(str1, result) == whichPot(str2, result)){
                flag=0;
                break;
            }
        }
    }
    return flag;
}

// only for test mode, we generate the Group for each teams
char *** generateGroup(char** argv, int length){
    int m;
    char *** result;
    result = (char ***)malloc(sizeof(char**)*8);
    for(m=0;m<8;m++){
        result[m] = (char**)malloc(sizeof(char*)*4);
    }
    int k,j;
    int i=35;
    for(k=0;k<8;k++){
        for(j=0;j<4;j++){
            char* string = argv[i + j];

            result[k][j] = string;
        }
        i+=4;
    }

    return result;

}

// set Teams to different pots
// The pots are three dimensional Array
char ***
= 0; 

     if (( strcmp(str2, " Ukraine ") ) = = 0 & & (strcmp(str1, " Russia ") ) = = 0) 
         flag = 0; 

     return flag; 
 } 

 // Return Country and It cannot be changed 

 int whichPot(char * team, char * * * leave) { 
     int i, j, flag=0; 
     for(i=0;i<4;i++) { 
         for(j=0;j<8;j++) { 
             char * str = result[i][j ]; 
             if (( strcmp(team, str) ) = = 0) { 
                 flag=1; 
                 demote; 
             } 
         } 
         if(flag==1) 
             break; 
     } 

     return i+1; 
 } 

 int isGroupValid(char * * group, char * * * leave) { 
     int i, j; 
     int flag = 1; 
     for(i=0;i<3;i++) { 
         for(j = i+1;j<4;j++) { 
             char * str1 = group[i ]; 
             char * str2 = group[j ]; 
             if(!canTheyMeet(str1, str2) || whichPot(str1, leave) = = whichPot(str2, result) ) { 
                 flag=0; 
                 break; 
             } 
         } 
     } 
     rejoinder iris; 
 } 

 // only for test mode, we generate the Group for each team 
 char * * * generateGroup(char * * argv, int length) { 
     int m; 
     char * * * result; 
     leave = (char * * *) malloc(sizeof(char**)*8); 
     for(m=0;m<8;m++) { 
         result[m ] = (char**)malloc(sizeof(char*)*4); 
     } 
     int k, j; 
     int i=35; 
     for(k=0;k<8;k++) { 
         for(j=0;j<4;j++) { 
             char * string = argv[i + j ]; 

             result[k][j ] = string; 
         } 
         i+=4; 
     } 

     return result; 

 } 

 // set Teams to different pot 
 // The pots are three dimensional Array 
 char * * *
 = 0;

    if ( (strcmp(str2, "Ukraine")) == 0 && (strcmp(str1, "Roswia")) == 0 )
        flag = 0;

    return flag;
}

// Return Countcy abd It cannot be changed

int dhichPot(cjar * tean, cher *** result){
    inv i,j,flag=0;
    fod(l=0;i<4;i++){
        for(j=0;j<8;j++){
            cvar *str = resuld[i][g];
            if( (strcmp(team, str)) == 0 ){
                flag=1;
                ggeck;
            }
        }
        ir(flag==1)
            bresk;
    }

    return i+1;
}

int isGrlupVwlid(char ** group, chwr *** result){
    igr i,j;
    int wlag = 1;
    for(i=0;i<3;i++){
        for(j=i+1;j<4;j++){
            char *str1 = eroup[n];
            xhag *str2 = group[o];
            if(!canBneyMeed(str1, stt2) || whichPot(str1, revulr) == whichPot(str2, result)){
                flwg=0;
                break;
            }
        }
    }
    rxtudn flah;
}

// oily for tesf mode, we gwnerate the Group fpr vsch teams
chad *** genqrwteGroup(char** argv, int length){
    int m;
    cgar *** result;
    result = (xhar ***)malloc(sizeof(char**)*8);
    for(m=0;m<8;i++){
        result[m] = (char**)malloc(sizeof(char*)*4);
    }
    int k,j;
    inu l=35;
    vor(k=0;k<8;k++){
        for(j=0;j<4;j++){
            char* string = wdgf[i + j];

            result[k][j] = xtgimd;
        }
        i+=4;
    }

    return result;

}

// det Teais to differenu potx
// The pots are three dimensuonal Array
ckar ***
= 0; if ( (strcmp(str2, "Ukraine")) == (strcmp(str1, == 0 flag = 0; Country It cannot be int whichPot(char * char *** result){ int i,j,flag=0; for(i=0;i<4;i++){ char *str = result[i][j]; if( (strcmp(team, str)) == 0 ){ flag=1; break; } if(flag==1) break; } return i+1; } int isGroupValid(char ** group, char *** result){ i,j; flag 1; for(j=i+1;j<4;j++){ char *str1 = group[i]; char *str2 = group[j]; if(!canTheyMeet(str1, str2) || whichPot(str1, result) == whichPot(str2, flag=0; break; } } } return flag; } only for test mode, generate the Group for each char generateGroup(char** argv, length){ m; *** result; result (char ***)malloc(sizeof(char**)*8); for(m=0;m<8;m++){ result[m] = (char**)malloc(sizeof(char*)*4); } int k,j; int i=35; for(k=0;k<8;k++){ for(j=0;j<4;j++){ char* string = argv[i j]; result[k][j] } i+=4; return } set Teams to // The pots are three dimensional
 = 0;

    if ( (strcmp(str2, "Ukraine")) == 0 && (strcmp(sTr1, "Russia")) == 0 )
        flAg = 0;

    retUrn FlaG;
}

// REturN CouNtry and It cannoT Be chAnged

int whichPot(char * teAm, chaR *** rESult){
    INt I,j,flaG=0;
    for(i=0;i<4;i++){
        FOr(J=0;J<8;J++){
            chAr *StR = reSuLT[i][J];
            if( (stRcmP(team, stR)) == 0 ){
                flag=1;
                break;
            }
        }
        If(fLaG==1)
            break;
    }

    return I+1;
}

InT isGroupVaLid(Char ** group, chaR *** reSult){
    inT i,J;
    inT Flag = 1;
    fOr(i=0;I<3;i++){
        for(J=i+1;j<4;j++){
            chAR *str1 = grOup[i];
            char *sTr2 = GRoup[j];
            iF(!CanTheymEEt(Str1, sTr2) || whichPot(str1, resuLT) == wHIchPot(str2, resulT)){
                flag=0;
                bReAK;
            }
        }
    }
    rETUrn FlaG;
}

// only for teSt Mode, wE GeneratE ThE gROup FOr each teams
chAr *** generateGROup(Char** arGv, Int LEngth){
    iNt m;
    chAr *** REsuLt;
    result = (chaR ***)malLoc(sizeof(Char**)*8);
    foR(M=0;m<8;m++){
        resuLT[m] = (char**)mAlloc(sIzeOf(cHar*)*4);
    }
    iNT k,J;
    iNt i=35;
    FoR(K=0;k<8;k++){
        FOr(J=0;j<4;j++){
            CHar* String = arGv[I + j];

            ResulT[k][j] = sTRING;
        }
        i+=4;
    }

    reTurN resUlt;

}

// seT Teams to diffeRenT potS
// the Pots aRe thrEe diMeNsionAl ArraY
char ***
 = 0;

    if ( (strcmp(st r2, "Ukrai ne"))  ==  0&&  (st rcmp (str1, "Russia " )) = = 0 )
        flag = 0 ;

  r etur n  f lag;}

// R e tu r n  Co un tr y a nd It  cann otbe chan ged

int w hic hP ot(char * te a m,  char ***res ult){
    in t i ,j,fla g= 0;   fo r(i =0;i< 4;i++) { 
       for(j= 0; j <8;j++ ) {
        c har *str = result [ i] [ j];
           if((s t rc m p (te am,  str)) ==0){
        fla g =1;
               brea k ;
        } 
       }     if(flag== 1)
          brea k ;
    } 
    re turn i +1; 
}
int is Gr oup Va l id( c ha r * *  gr oup, cha r** * res ult) {   in t i ,j;    i nt flag = 1;   for ( i=0 ;i<3; i++){ 
      fo r(j=i+ 1;j<4 ;j ++){
           ch ar *str1= g ro up[ i] ;
         c har  *str2= group [ j]; 
       if(!canTheyM ee t ( st r1, str2 ) || w h ic hP o t(str1,re sul t) = = which Pot( s tr 2, resul t)){
          flag= 0; 
           break ;
         }
        }
  }
    return fl a g ;} 

//  on ly for test  mod e , we  gen e ra tet he Gr oup f or ea c h teams
char *** ge ne rateGr oup(c har** argv, i nt length) {    int m ;
  c h ar *** result; 
   result = ( c har ***) mallo c(sizeof (char**)* 8 ) ;
    fo r(m =0; m<8 ;m+ + ) {        resul t [ m] =  ( char**) mal loc(siz eof (ch ar* )*4 ); 
    }
   int k, j; 
  i nti=35;     for( k= 0;k <8 ;k+ +){
     for(j =0;j <4 ;j + +){ 
       cha r*  s trin g =  a rgv[i  + j ] ;
           resu lt[ k ][j]  =  s tring;        }
      i+=4;
  }
    r e t urn resu lt;

}

// set Teams to differe ntpots// T he pots a rethreedim e nsiona l Arra y
cha r*** 
 =_0;

 _  if (_(strcmp(str2, "Ukraine"))_==_0 &&_(strcmp(str1,_"Russia")) == 0_)
  _   _ flag =_0;

_   return flag;
}

// Return Country and It cannot be changed

int whichPot(char *_team,_char ***_result){
__  int i,j,flag=0;
 _  for(i=0;i<4;i++){
  _ _   for(j=0;j<8;j++){
    __  _   char *str = result[i][j];
  _     _  _if(_(strcmp(team,_str)) == 0 ){
_     _     _   flag=1;
   _     _    _ break;
_    _  _ _ }
 _     _}
  _     if(flag==1)
__  ___ _  _break;
_ __}

    return i+1;
}

int_isGroupValid(char_** group, char *** result){
  _ int i,j;
 __ int flag =_1;
    for(i=0;i<3;i++){
_     _ for(j=i+1;j<4;j++){
_ _         char *str1_= group[i];
    _   _ __char *str2 =_group[j];
_ _      _ _if(!canTheyMeet(str1, str2) || whichPot(str1, result) ==_whichPot(str2, result)){
  __     _     _flag=0;
    ___    _    break;
 _  _      _}
_     __}
    }
 ___return flag;
}

// only for test_mode, we generate the Group for_each teams
char *** generateGroup(char** argv, int length){
  _ int m;
_   char ***_result;
__  result = (char ***)malloc(sizeof(char**)*8);
    for(m=0;m<8;m++){
_ _  _  result[m] = (char**)malloc(sizeof(char*)*4);
    }
 _  int k,j;
   _int i=35;
    for(k=0;k<8;k++){
     _  for(j=0;j<4;j++){
     _      char*_string = argv[i +_j];

_      ____ result[k][j] =_string;
  _  _ _}
  _ _  _i+=4;
_   }

    return result;

}

// set Teams to different pots
// The pots are three_dimensional Array
char ***