# CF6A Triangle

However, after a while he found out that different tricky things can occur. It can happen that it is impossible to construct a triangle of a positive area, but it is possible to construct a degenerate triangle. It can be so, that it is impossible to construct a degenerate triangle even.

Code：

#include<iostream>
#include<cmath>
#include<cstdio>
#include<algorithm>
#define LL long long
#define maxn 10001
using namespace std;
int a[5];
int main(){
for(int i=1;i<=4;i++){
cin>>a[i];
}
sort(a+1,a+5);
for(int i=1;i<=4;i++){
for(int j=i+1;j<=4;j++){
for(int k=j+1;k<=4;k++){
if(a[i]+a[j]>a[k]){
cout<<"TRIANGLE"<<endl;
return 0;
}
}
}
}
for(int i=1;i<=4;i++){
for(int j=i+1;j<=4;j++){
for(int k=j+1;k<=4;k++){
if(a[i]+a[j]==a[k]){
cout<<"SEGMENT"<<endl;
return 0;
}
}
}
}
cout<<"IMPOSSIBLE"<<endl;
return 0;
}