Language: C++

#include <stdio.h>
#include <algorithm>
#include <string>
#include <set>
#include <iostream>

int main( void ) {
	
	int M;
	char S[73];
	
	typedef set<string> set_t;
	
	scanf( "%d", &M );
	
	while ( M-- ) {
		
		scanf( "%s", S );
		
		set_t all;
		all.insert( S );
		
		for ( size_t i = 1; i < S.size(); i++ ) {
			
			string L = S;
			L.resize( i );
			string R = S.substr( i );
			
			string L2 = L, R2 = R;
			reverse( L2.begin(), L2.end() );
			reverse( R2.begin(), R2.end() );
			
			all.insert( R + L );
			all.insert( R + L2 );
			all.insert( R2 + L );
			all.insert( R2 + L2 );
			all.insert( L + R );
			all.insert( L + R2 );
			all.insert( L2 + R );
			all.insert( L2 + R2 );
			
		}
		
		printf( "%d", all.size() );
		
	}
	
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'set' does not name a type
   12 |         typedef set<string> set_t;
      |                 ^~~
a.cc:20:17: error: 'set_t' was not declared in this scope
   20 |                 set_t all;
      |                 ^~~~~
a.cc:21:17: error: 'all' was not declared in this scope; did you mean 'atoll'?
   21 |                 all.insert( S );
      |                 ^~~
      |                 atoll
a.cc:23:43: error: request for member 'size' in 'S', which is of non-class type 'char [73]'
   23 |                 for ( size_t i = 1; i < S.size(); i++ ) {
      |                                           ^~~~
a.cc:25:25: error: 'string' was not declared in this scope
   25 |                         string L = S;
      |                         ^~~~~~
a.cc:25:25: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from a.cc:3:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:26:25: error: 'L' was not declared in this scope
   26 |                         L.resize( i );
      |                         ^
a.cc:27:31: error: expected ';' before 'R'
   27 |                         string R = S.substr( i );
      |                               ^~
      |                               ;
a.cc:29:31: error: expected ';' before 'L2'
   29 |                         string L2 = L, R2 = R;
      |                               ^~~
      |                               ;
a.cc:30:34: error: 'L2' was not declared in this scope
   30 |                         reverse( L2.begin(), L2.end() );
      |                                  ^~
a.cc:30:25: error: 'reverse' was not declared in this scope; did you mean 'std::reverse'?
   30 |                         reverse( L2.begin(), L2.end() );
      |                         ^~~~~~~
      |                         std::reverse
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: 'std::reverse' declared here
  249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last);
      | ^~~~~~~
a.cc:31:34: error: 'R2' was not declared in this scope
   31 |                         reverse( R2.begin(), R2.end() );
      |                                  ^~
a.cc:33:37: error: 'R' was not declared in this scope
   33 |                         all.insert( R + L );
      |                                     ^