#include <cstdio>

FILE* fin=fopen("box.in","rt");
FILE* fout=fopen("box.out","wt");

struct _box
{
	_box()
	{
		w=0;
		h=0;
		free=true;
	}

	int neigb;
	bool free;
	int w, h;

	_box operator=(const _box& src)
	{
		w=src.w;
		h=src.h;
		return *this;
	}

	bool operator==(const _box& src)
	{
		return ((w==src.w && h==src.h) || (w==src.h && h==src.w));
	}
};

int main()
{
	_box a[6];
	bool bpossible=true;
	int j;
	fscanf(fin,"%d",&a[0].w);
	fscanf(fin,"%d",&a[0].h);
	fscanf(fin,"%d",&a[1].w);
	fscanf(fin,"%d",&a[1].h);
	fscanf(fin,"%d",&a[2].w);
	fscanf(fin,"%d",&a[2].h);
	fscanf(fin,"%d",&a[3].w);
	fscanf(fin,"%d",&a[3].h);
	fscanf(fin,"%d",&a[4].w);
	fscanf(fin,"%d",&a[4].h);
	fscanf(fin,"%d",&a[5].w);
	fscanf(fin,"%d",&a[5].h);

	for (int i=0; i<6; ++i)
	{
		if (a[i].free)
			for (j=0; j<6; ++j)
			{
				if (i==j || !a[j].free)
					continue;

				if (a[i]==a[j])
				{
					a[i].free=false;
					a[i].neigb=j;
					a[j].free=false;
					a[j].neigb=i;
					break;
				}
			}
	}

	for ( i=0; i<6; ++i)
	{
		if (a[i].free)
			bpossible=false;
	}

	_box g1, g2, g3;
	if (bpossible)
	{
		for (i=1; i<6; ++i)
		{
			if (i!=a[0].neigb)
			{
				j=i;
				break;
			}
		}

		g1=a[0];
		g2=a[j];

		for (i=1; i<6; ++i)
		{
			if (i!=a[0].neigb && i!=j && i!=a[j].neigb)
			{
				j=i;
				break;
			}
		}

		g3=a[j];

		if (g1.w==g2.w)
		{
			if (g1.h==g3.w)
			{
				if (g2.h!=g3.h)
					bpossible=false;
			}
			else if ((g1.h==g3.h))
			{
				if (g2.h!=g3.w)
					bpossible=false;
			}
			else
				bpossible=false;
		}
		else if (g1.w==g2.h)
		{
			if (g1.h==g3.w)
			{
				if (g2.w!=g3.h)
					bpossible=false;
			}
			else if ((g1.h==g3.h))
			{
				if (g2.w!=g3.w)
					bpossible=false;
			}
			else
				bpossible=false;
		}
		else if (g1.h==g2.w)
		{
			if (g1.w==g3.w)
			{
				if (g2.h!=g3.h)
					bpossible=false;
			}
			else if ((g1.w==g3.h))
			{
				if (g2.h!=g3.w)
					bpossible=false;
			}
			else
				bpossible=false;
		}
		else if (g1.h==g2.h)
		{
			if (g1.w==g3.w)
			{
				if (g2.w!=g3.h)
					bpossible=false;
			}
			else if ((g1.w==g3.h))
			{
				if (g2.w!=g3.w)
					bpossible=false;
			}
			else
				bpossible=false;
		}
		else
			bpossible=false;
	}

	if (bpossible)
		fprintf(fout,"POSSIBLE");
	else
		fprintf(fout,"IMPOSSIBLE");

	fclose(fin);
	fclose(fout);
	return 0;
}