#include <iostream>
#include <algorithm>
#include <set>
using namespace std;
int main()
{
set<int> s; // 12個數字中不能出現3個以上不同的值,最多只有三種值:長、寬、高
int face[6];
int i = 0, w, h;
while (cin >> w >> h)
{
if (s.size() <= 3)
{
s.insert(w);
s.insert(h);
if (w > h)
face[i] = (h << 16) | w; // 充分利用條件 1 <= w,h <= 10000
else
face[i] = (w << 16) | h;
}
if (++i == 6)
{
if (s.size() <= 3)
{
sort(face, face+6);
for (i = 0; i < 6; i += 2)
{ // 判斷是否存在3對相等的面
if (face[i] != face[i+1])
break;
}
if (i == 6)
cout << "POSSIBLE" << endl;
else
cout << "IMPOSSIBLE" << endl;
}
else
{
cout << "IMPOSSIBLE" << endl;
}
i = 0;
s.clear();
}
}
return 0;
}