#include <LEDA/set.h>


main()
{

set<string> S;
set<string> S1;
set<string> S2;

string s;

cout << "S1 = ";
while (cin >> s) 
{ if (s == ".") break;
  S1.insert(s);
 }

cout << "S2 = ";
while (cin >> s) 
{ if (s == ".") break;
  S2.insert(s);
 }


S = S1 + S2;
cout << "S1 + S2  = ";
forall(s,S) cout << s << " ";
newline;

S = S1 - S2;
cout << "S1 - S2 = ";
forall(s,S) cout << s << " ";
newline;

S = S2 - S1;
cout << "S2 - S1 = ";
forall(s,S) cout << s << " ";
newline;


S = S1 & S2;
cout << "S1 & S2 = ";
forall(s,S) cout << s << " ";
newline;

S = S1 % S2;
cout << "S1 % S2 = ";
forall(s,S) cout << s << " ";
newline;


cout << "S1 == S2 = " << (S1 == S2) << endl;;

cout << "S1 != S2 = " << (S1 != S2) << endl;;

cout << "S1 <= S2 = " << (S1 <= S2) << endl;;

cout << "S1 >= S2 = " << (S1 >= S2) << endl;;

cout << "S1 < S2 = " << (S1 < S2) << endl;;

cout << "S1 > S2 = " << (S1 > S2) << endl;;




return 0;

}

