#include "stdio.h"int main(void) { int num; int length; char str_out[100][51]; int index; int index1; int result[100]; int a=0; int b=0; int min=0; int num2=0; int temp; int min_index; #ifndef ONLINE_JUDGE freopen("in.txt","r",stdin); #else #endif scanf("%d%d",&length,&num); num2=num; temp=num2; while(num>0){ scanf("%s", str_out[a]); if(num2 == 1){ printf("%sn",str_out[a]); return 0; } result[a] = 0; for(index=0;indexstr_out[a][index1])result[a]++; } } } num--; a++; } while(num2>0){ if(result[b]==5000) { b++; continue; } min = result[b]; min_index = b; for(index=0;index result[index+1]){ min = result[index+1]; min_index =index+1; } } result[min_index] = 5000; num2--; printf("%sn",str_out[min_index]); min_index = 0;} #ifndef ONLINE_JUDGE fclose(stdin); #else #endif return 0;