原题链接
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
using namespace std;
typedef long long int LL;
const int MAX = 1010, INF = 1<<30;
int M, N, S;
string name[MAX];
map<string, bool> flag;
int main()
{
scanf("%d %d %d", &M, &N, &S);
for(int i=1; i<=M; i++)
{
cin>>name[i];
flag[name[i]] = 0;
}
if(M < S) cout<<"Keep going..."<<endl;
for(int j=S; j<=M; j+=N)
{
while(j<=M && flag[name[j]]) j++;
if(j > M) break;
cout<<name[j]<<endl;
flag[name[j]] = 1;
}
return 0;
}