#include
<
iostream
>
#include < string >
#include < vector >
// #include <algorithm>
using namespace std;
int main()
{
int count = 1 ;
string s;
while (cin >> s)
{
vector < string > svec;
while (s != " 9 " )
{
svec.push_back(s);
cin >> s;
}
bool tag = false ;
for (vector < string > ::iterator it = svec.begin(); it != svec.end(); ++ it)
{
for (vector < string > ::iterator k = (it + 1 ); k != svec.end(); ++ k)
{
tag = true ;
string s1 = * it;
string s2 = * k;
int t1 = s1.size();
int t2 = s2.size();
int minnumber = (t1 >= t2 ? t2:t1);
for ( int i = 0 ; i < minnumber; ++ i)
{
if (s1[i] != s2[i])
{
tag = false ;
break ;
}
}
if (tag == true )
{
break ;
}
}
if (tag == true )
{
break ;
}
}
if (tag)
{
cout << " Set " << count << " is not immediately decodable " << endl;
}
else
{
cout << " Set " << count << " is immediately decodable " << endl;
}
count ++ ;
}
return 0 ;
}
#include < string >
#include < vector >
// #include <algorithm>
using namespace std;
int main()
{
int count = 1 ;
string s;
while (cin >> s)
{
vector < string > svec;
while (s != " 9 " )
{
svec.push_back(s);
cin >> s;
}
bool tag = false ;
for (vector < string > ::iterator it = svec.begin(); it != svec.end(); ++ it)
{
for (vector < string > ::iterator k = (it + 1 ); k != svec.end(); ++ k)
{
tag = true ;
string s1 = * it;
string s2 = * k;
int t1 = s1.size();
int t2 = s2.size();
int minnumber = (t1 >= t2 ? t2:t1);
for ( int i = 0 ; i < minnumber; ++ i)
{
if (s1[i] != s2[i])
{
tag = false ;
break ;
}
}
if (tag == true )
{
break ;
}
}
if (tag == true )
{
break ;
}
}
if (tag)
{
cout << " Set " << count << " is not immediately decodable " << endl;
}
else
{
cout << " Set " << count << " is immediately decodable " << endl;
}
count ++ ;
}
return 0 ;
}