#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main()
{
    int N,A,x,y,a,b,c,d,e,f,g,h;
    srand(time(0));
    scanf("%d",&N);
    scanf("%d",&A);
    x=rand()%A+1;
    y=rand()%A+1;
    a=rand()%A+1;
    b=rand()%A+1;
    c=rand()%A+1;
    d=rand()%A+1;
    e=rand()%A+1;
    f=rand()%A+1;
    g=rand()%A+1;
    h=rand()%A+1;
    if(x==y)
        x++;
    if(a==b)
        a++;
    if(c==d)
        c++;
    if(e==f)
        e++;
    if(g==h)
        g++;
        printf("%d %d\n",x,y);
        printf("%d %d\n",a,b);
        printf("%d %d\n",c,d);
        printf("%d %d\n",e,f);
        printf("%d %d\n",g,h);







    return 0;
}