#include <iostream>
#include <iomanip>
#include <algorithm>
using namespace std;
#define MAX 100010
struct node
{
int add;
int key;
int next;
int flag;
};
bool cmp(node a, node b)
{
return a.key < b.key;
}
int main()
{
int n, first;
cin >> n >> first;
int i,x;
node *s = new node[MAX];