#include <stdio.h>
#include <stdlib.h>
struct node
{
int data;struct node *next;
};
struct node *head,*tail;
void creat(int n);
void right(struct node *head,int a,int b);
void delet(struct node *head,int a);
void change(struct node *head,int a,int b);
void print(struct node *head);
int main()
{
int n,m,i,ch,a,b;
while (scanf("%d%d",&n,&m)!=EOF