#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct SN{
    char ti[101];
    struct SN* p;
    struct SN* n;
};
int f(struct SN* h){
    if(h == NULL){
        return 1;
    }
    struct SN* t = h->p;
    t->n = NULL;
    struct SN* c = h;
    while(c != NULL){
        struct SN* te = c;
        c = c->n;
        free(te);
    }
    return 1;
}
int main(){
    int n, i;
    struct SN *h = NULL, *t = NULL;
    char b[101];
    char d[101];
    int ff = 0;
    int sc;
    if(scanf("%d", &n) != 1){
        printf("Invalid input");
        return 1;
    }
    sc = n;
    for(i=0; i<n; i++){
        if(scanf("%100s", b) != 1){
            printf("Invalid input");
            f(h);
            return 1;
        }
        struct SN* nN = (struct SN*)malloc(sizeof(struct SN));
        strcpy(nN->ti, b);
        if(h == NULL){
            h = t = nN;
        }else{
            t->n = nN;
            nN->p = t;
            t = nN;
        }
    }
    if(h != NULL){
        t->n = h;
        h->p = t;
    }
    scanf("%100s", d);
    if(h != NULL){
        struct SN *c = h;
        for(i=0; i<sc; i++){
            if(strcmp(c->ti, d) == 0){
                ff = 1;
                if(sc == 1){
                    h = t = NULL;
                }else{
                    c->p->n = c->n;
                    c->n->p = c->p;
                    if(c == h){
                        h = c->n;
                    }
                    if(c == t){
                        t = c->p;
                    }
                }
                f(c);
                sc--;
                break;
            }
            c = c->n;
        }
    }
    if(ff == 1){
        if(h == NULL){
            printf("Playlist is empty");
        }else{
            struct SN* te = h;
            for(i=0; i<sc; i++){
                printf("%s", te->ti);
                if(i<sc-1){
                    printf(" ");
                }
                te = te->n;
            }
            printf("\n");
        }
    }else{
        printf("Song is found");
    }
    if(head != NULL){
        f(h);
    }
    return 0;
}