#include <stdio.h>

#define FLOORS 50000000
#define ELEVS 100

int nsd(int a, int b)
{
  if (a<0) a= -a;
  if (b<0) b= -b;
  
  while (a && b)
  {
    if (a<b) b=(b-a) % a; else a=(a-b) % b;
  }
  return (a+b);
}

/* predpoklad b, d > 0 */
void nezapor(int b, int d, int * i, int * j)
{
  int n, dd, bb, zm1, zm2, zm;

  n=nsd(b, d);
  bb=b/n;
  dd=d/n;

  if ( ((*i)<0) || ((*j)<0) )
  {
    zm1=(-(*i)-1)/dd+1;
    zm2=(-(*j)-1)/bb+1;
    if (zm1 < zm2) zm=zm2; else zm=zm1;
    *i += zm * dd;
    *j += zm * bb;
  }

  if (((*i) >= dd) && ((*j) >= bb))
  {
    zm1=(*i) / dd;
    zm2=(*j) / bb;
    if (zm1 < zm2) zm=zm1; else zm=zm2;
    *i -= zm * dd;
    *j -= zm * bb;
  }
}

int diof(int z, int b, int d, int * i, int * j)
{
  if (z == 0)
  {
    *i = 0;
    *j = 0;
  } else
  if (b == 0)
  {
    if (z % d != 0) return -1; else    
    {
      *i = 0;
      *j = (-z)/d;
    }
  } else
  if (d == 0)
  {
    if (z % b != 0) return -1; else
    {
      *i = z/b;
      *j = 0;
    }
  } else /* predpoklad b, d > 0 */
  if (b <= d)
  {
    if (diof(z, b, d % b, i, j)<0) return -1;
    
    *i += (d / b) * (*j);
    nezapor(b, d, i, j);
  } else
  {
    if (diof(-z, d, b % d, j, i)<0) return -1;
    
    *j += (b / d) * (*i);
    nezapor(b, d, i, j);
  }
  return 0;
}


/* vraci 1, lze-li mezi vytahy prestoupit, jinak 0 */
int test(int f, int f1, int x1, int f2, int x2)
{
  int i, j;
  
  if (diof(f2-f1, x1, x2, &i, &j)<0) return 0;
  if ( (i>=0) && (j>=0) && (i<f) && (j<f)) return 1;
  return 0;
}

int porov(int p, int q)
{
  if (q == 0)
  {
    if (p == 0) return 1;
  } else
  if (p % q == 0) return 1;
  return 0;
}

int main()
{
  int n, i, j, p, q;
  int elevs[ELEVS][2], e, a, b, f, eflg[ELEVS], eque[ELEVS], qlen, t;
  int edg[ELEVS][ELEVS];
  FILE * fi;

/*  fi=fopen("f.in", "rt"); */
  fi=stdin;
  
  fscanf(fi, "%d\n", &n);
  for (i=0; i<n; i++)
  {
    fscanf(fi, "%d %d %d %d\n", &f, &e, &a, &b);
    for (j=0; j<e; j++) fscanf(fi, "%d %d\n", &elevs[j][1], &elevs[j][0]);
    
    for (p=0; p<e; p++)
     for (q=0; q<e; q++) edg[p][q]=test(f, elevs[p][0], elevs[p][1],
                                           elevs[q][0], elevs[q][1]);

    qlen=0;
    for (j=0; j<e; j++)
     if ((a>=elevs[j][0]) && porov(a-elevs[j][0], elevs[j][1]))
     {
       eque[qlen++]=j;
       eflg[j]=1;
     } else
       eflg[j]=0;
       
    while (qlen>0)
    {
      int s;
      s=eque[--qlen];
      for (j=0; j<e; j++)
       if (edg[s][j] && ! eflg[j])
       {
         eflg[j]=1;
         eque[qlen++]=j;
       }
    }

    t=0;
    for (j=0; j<e; j++)
     if (eflg[j] && (b>=elevs[j][0]) && porov(b-elevs[j][0], elevs[j][1]))
       t=1;
    if (t)
      printf("It is possible to move the furniture.\n"); else
      printf("The furniture cannot be moved.\n");
  }
  
  return 0;   
}

