#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 100int n, w, s;char name[maxn][100];bool out[maxn];int main(){ scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%s", name[i]); scanf("%d,%d", &w, &s); memset(out, 0, sizeof(out)); int pos = w - 1; for (int i = n; i > 0; i--) { int x = s % (i + 1); while (out[pos % n]) pos++; for (int j = 0; j < x; j++) { while (out[pos % n]) pos++; if (j == x - 1) break; pos++; } out[pos % n] = true; printf("%sn", name[pos % n]); pos %= n; } return 0;}