#include <iostream>

using namespace std;

int main()
{
    int a,b,c[a],i;
    cin>>a>>b;
    i=0;
    while (i<=a)
    {
        cin>>c[i];
        i++;
    }
    i=0;
    while (i<=a)
    {
        if (c[i]==b)
            cout<<c[i+1];
            i++;
    }
}