=={{header|Perl 6}}==
{{works with|Rakudo|2019.07.1}}
Much of the previous exposition here is superfluous as the reference word list has changed.
Using the same file as the reference implementation (Lychen), downloaded to a local file to give my connection a break.
There doesn't seem to be any restriction that the word needs to consist only of lowercase letters, so words of any case are included. Since the example code specifically shows the example words (TEA, EAT, ATE) in uppercase, I elected to uppercase the found words. Most of them are anyway, as this list seems to be full of abbreviations, acronyms and initialisms. Ah well. I didn't choose the word list.
<lang perl6>my %words;
'./wordswordlist.txt10000'.IO.slurp.words.map: { .chars < 3 ?? (next) !! %words{.uc.comb.sort.join}.push: $_.uc };
for %words.keys { %words{$_}:delete if %words{$_}.elems < 2 or $_.chars < 3 };
my @teacups;
} else {
@print = ();
last MAYBE
}
}
}
say .unique.join(", ") if .elems for sort @teacups;</lang>
{{out}}
<pre>AAEAAA, AEAAAA, EAAAAA
AAF, AFA, FAA
AAH, AHA, HAA
AAM, AMA, MAA
AAS, ASA, SAA
ABB, BBA, BAB
ABD, BDA, DAB
ABI, BIA, IAB
ABL, BLA, LAB
ABM, BMA, MAB
ABR, BRA, RAB
ABS, BSA, SAB
ABV, BVA, VAB
ACC, CCA, CAC
ACD, CDA, DAC
ACF, CFA, FAC
ACH, CHA, HAC
ACM, CMA, MAC
ACP, CPA, PAC
ACS, CSA, SAC
ACT, CTA, TAC
ACV, CVA, VAC
ACW, CWA, WAC
ADAD, DADA
ADAR, DARA, ARAD, RADA
ADB, DBA, BAD
ADC, DCA, CAD
ADD, DDA, DAD
ADE, DEA, EAD
ADF, DFA, FAD
ADI, DIA, IAD
ADM, DMA, MAD
ADN, DNA, NAD
ADO, DOA, OAD
ADP, DPA, PAD
ADS, DSA, SAD
AEC, ECA, CAE
AER, ERA, RAE
AES, ESA, SAE
AET, ETA, TAE
AFC, FCA, CAF
AFI, FIA, IAF
AFL, FLA, LAF
AFR, FRA, RAF
AGAG, GAGA
AGC, GCA, CAG
AGD, GDA, DAG
AGH, GHA, HAG
AGR, GRA, RAG
AGS, GSA, SAG
AGT, GTA, TAG
AHI, HIA, IAH
AIC, ICA, CAI
AIL, ILA, LAI
AIM, IMA, MAI
AIR, IRA, RAI
AIS, ISA, SAI
AIT, ITA, TAI
AKE, KEA, EAK
AKH, KHA, HAK
AKO, KOA, OAK
ALC, LCA, CAL
ALE, LEA, EAL
ALG, LGA, GAL
ALI, LIA, IAL
ALIT, LITA, ITAL, TALI
ALT, LTA, TAL
AMAN, MANA, ANAM, NAMA
AMAR, MARA, ARAM, RAMA
AMB, MBA, BAM
AMC, MCA, CAM
AME, MEA, EAM
AMEL, MELA, ELAM, LAME
AMEN, MENA, ENAM, NAME
AMI, MIA, IAM
AMO, MOA, OAM
AMOR, MORA, ORAM, RAMO
AMP, MPA, PAM
AMR, MRA, RAM
AMS, MSA, SAM
AMT, MTA, TAM
AMU, MUA, UAM
AMY, MYA, YAM
ANAN, NANA
ANC, NCA, CAN
AND, NDA, DAN
ANE, NEA, EAN
ANG, NGA, GAN
ANH, NHA, HAN
ANI, NIA, IAN
ANIL, NILA, ILAN, LANI
ANS, NSA, SAN
ANY, NYA, YAN
AOB, OBA, BAO
AOL, OLA, LAO
AOP, OPA, PAO
AOR, ORA, RAO
AOS, OSA, SAO
APC, PCA, CAP
APG, PGA, GAP
APH, PHA, HAP
APL, PLA, LAP
APM, PMA, MAP
APO, POA, OAP
APP, PPA, PAP
APR, PRA, RAP
APS, PSA, SAP
APT, PTA, TAP
ARAR, RARA
ARAS, RASA, ASAR, SARA
ARC, RCA, CAR
ARD, RDA, DAR
ARE, REA, EAR
ARF, RFA, FAR
ARIS, RISA, ISAR, SARI
ARM, RMA, MAR
ARN, RNA, NAR
ARO, ROA, OAR
ARS, RSA, SAR
ART, RTA, TAR
ARU, RUA, UAR
ARY, RYA, YAR
ASB, SBA, BAS
ASC, SCA, CAS
ASE, SEA, EAS
ASEL, SELA, ELAS, LASE
ASER, SERA, ERAS, RASE
ASH, SHA, HAS
ASI, SIA, IAS
ASK, SKA, KAS
ASM, SMA, MAS
ASN, SNA, NAS
ASP, SPA, PAS
ASR, SRA, RAS
ASS, SSA, SAS
AST, STA, TAS
ASW, SWA, WAS
ATB, TBA, BAT
ATC, TCA, CAT
ATE, TEA, EAT
ATHIII, THAIII, HATIII
ATM, TMA, MAT
ATO, TOA, OAT
ATR, TRA, RAT
ATV, TVA, VAT
AUC, UCA, CAU
AUD, UDA, DAU
AUL, ULA, LAU
AUM, UMA, MAU
AUN, UNA, NAU
AUS, USA, SAU
AVG, VGA, GAV
AYH, YHA, HAY
AYM, YMA, MAY
BCR, CRB, RBC
BCS, CSB, SBC
BDC, DCB, CBD
BDT, DTB, TBD
BEC, ECB, CBE
BED, EDB, DBE
BER, ERB, RBE
BES, ESB, SBE
BID, IDB, DBI
BLL, LLB, LBL
BLO, LOB, OBL
BMG, MGB, GBM
BMI, MIB, IBM
BMP, MPB, PBM
BOM, OMB, MBO
BOO, OOB, OBO
BOT, OTB, TBO
BRC, RCB, CBR
BSC, SCB, CBS
BSD, SDB, DBS
BSO, SOB, OBS
BSS, SSB, SBS
BST, STB, TBS
BSW, SWB, WBS
BUS, USB, SBU
BYO, YOB, OBY
CCD, CDC, DCC
CCF, CFC, FCC
CCI, CIC, ICC
CCM, CMC, MCC
CCP, CPC, PCC
CCR, CRC, RCC
CCS, CSC, SCC
CCT, CTC, TCC
CCW, CWC, WCC
CDI, DIC, ICD
CDN, DNC, NCD
CDO, DOC, OCD
CDS, DSC, SCD
CDU, DUC, UCD
CED, EDC, DCE
CEE, EEC, ECE
CEN, ENC, NCE
CFE, FEC, ECF
CFM, FMC, MCF
CFP, FPC, PCF
CFR, FRC, RCF
CGM, GMC, MCG
CHI, HIC, ICH
CHM, HMC, MCH
CHO, HOC, OCH
CHS, HSC, SCH
CID, IDC, DCI
CIM, IMC, MCI
CIO, IOC, OCI
CIP, IPC, PCI
CIR, IRC, RCI
CIS, ISC, SCI
CLE, LEC, ECL
CLR, LRC, RCL
CLU, LUC, UCL
CLY, LYC, YCL
CMD, MDC, DCM
CMI, MIC, ICM
CML, MLC, LCM
CMS, MSC, SCM
CMT, MTC, TCM
CNM, NMC, MCN
CNR, NRC, RCN
CON, ONC, NCO
COP, OPC, PCO
COR, ORC, RCO
COS, OSC, SCO
CPI, PIC, ICP
CPL, PLC, LCP
CPM, PMC, MCP
CPR, PRC, RCP
CPS, PSC, SCP
CRE, REC, ECR
CRL, RLC, LCR
CRO, ROC, OCR
CRS, RSC, SCR
CRT, RTC, TCR
CRU, RUC, UCR
CSE, SEC, ECS
CSF, SFC, FCS
CSI, SIC, ICS
CSL, SLC, LCS
CSM, SMC, MCS
CSO, SOC, OCS
CSP, SPC, PCS
CSR, SRC, RCS
CSS, SSC, SCS
CST, STC, TCS
CTD, TDC, DCT
CTE, TEC, ECT
CTF, TFC, FCT
CTG, TGC, GCT
CTO, TOC, OCT
CTT, TTC, TCT
CUE, UEC, ECU
CUR, URC, RCU
DDE, DED, EDD
DDS, DSD, SDD
DDT, DTD, TDD
DEN, END, NDE
DENI, ENID, NIDE, IDEN
DEP, EPD, PDE
DET, ETD, TDE
DFE, FED, EDF
DFI, FID, IDF
DIM, IMD, MDI
DIN, IND, NDI
DIT, ITD, TDI
DIU, IUD, UDI
DLI, LID, IDL
DLL, LLD, LDL
DLS, LSD, SDL
DME, MED, EDM
DMI, MID, IDM
DMS, MSD, SDM
DMT, MTD, TDM
DMV, MVD, VDM
DNI, NID, IDN
DOE, OED, EDO
DOI, OID, IDO
DOLI, OLID, LIDO, IDOL
DOS, OSD, SDO
DOU, OUD, UDO
DPE, PED, EDP
DPI, PID, IDP
DPP, PPD, PDP
DRU, RUD, UDR
DSE, SED, EDS
DSI, SID, IDS
DSM, SMD, MDS
DSO, SOD, ODS
DSP, SPD, PDS
DSR, SRD, RDS
DSS, SSD, SDS
DSU, SUD, UDS
DTE, TED, EDT
DTP, TPD, PDT
DYE, YED, EDY
DZO, ZOD, ODZ
EEK, EKE, KEE
EEL, ELE, LEE
EEM, EME, MEE
EEN, ENE, NEE
EER, ERE, REE
EFT, FTE, TEF
EGOR, GORE, OREG, REGO
EGP, GPE, PEG
EHF, HFE, FEH
EHR, HRE, REH
EIN, INE, NEI
EIR, IRE, REI
EIS, ISE, SEI
ELM, LME, MEL
ELS, LSE, SEL
EMM, MME, MEM
EMP, MPE, PEM
EMR, MRE, REM
EMS, MSE, SEM
ENOL, NOLE, OLEN, LENO
ENS, NSE, SEN
EOM, OME, MEO
EON, ONE, NEO
EPP, PPE, PEP
EPS, PSE, SEP
ERF, RFE, FER
ERI, RIE, IER
ERL, RLE, LER
ERS, RSE, SER
ERT, RTE, TER
ERY, RYE, YER
ESH, SHE, HES
ESL, SLE, LES
ESM, SME, MES
ESO, SOE, OES
ESOP, SOPE, OPES, PESO
ESP, SPE, PES
ESS, SSE, SES
EST, STE, TES
ETH, THE, HET
ETS, TSE, SET
ETY, TYE, YET
EYN, YNE, NEY
FMS, MSF, SFM
FOO, OOF, OFO
FOS, OSF, SFO
FOU, OUF, UFO
FRI, RIF, IFR
FRT, RTF, TFR
FSH, SHF, HFS
FSU, SUF, UFS
GON, ONG, NGO
GPI, PIG, IGP
GPS, PSG, SGP
GTO, TOG, OGT
HIN, INH, NHI
HIP, IPH, PHI
HIS, ISH, SHI
HMP, MPH, PHM
HMS, MSH, SHM
HMT, MTH, THM
HOO, OOH, OHO
HOP, OPH, PHO
HPO, POH, OHP
HRS, RSH, SHR
HSU, SUH, UHS
HTS, TSH, SHT
HUS, USH, SHU
ILO, LOI, OIL
ILS, LSI, SIL
IMS, MSI, SIM
IMT, MTI, TIM
IOR, ORI, RIO
IPL, PLI, LIP
IPR, PRI, RIP
IPS, PSI, SIP
IPTOOO, PTIOOO, TIPOOO
IRMWWW, RMIWWW, MIRWWW
IROXXX, ROIXXX, OIRXXX</pre>
ISIS, SISI
ISM, SMI, MIS
ISS, SSI, SIS
IST, STI, TIS
ITO, TOI, OIT
ITS, TSI, SIT
ITU, TUI, UIT
IXM, XMI, MIX
KTS, TSK, SKT
KUS, USK, SKU
LLP, LPL, PLL
LOT, OTL, TLO
LPP, PPL, PLP
LPS, PSL, SLP
LRS, RSL, SLR
LSM, SML, MLS
LSP, SPL, PLS
MMS, MSM, SMM
MMU, MUM, UMM
MOP, OPM, PMO
MORO, OROM, ROMO, OMOR
MOT, OTM, TMO
MPS, PSM, SMP
MRS, RSM, SMR
MSN, SNM, NMS
MSO, SOM, OMS
MSR, SRM, RMS
MSS, SSM, SMS
MST, STM, TMS
MTP, TPM, PMT
MTS, TSM, SMT
MTU, TUM, UMT
MVO, VOM, OMV
NOO, OON, ONO
NPP, PPN, PNP
NRO, RON, ONR
NSO, SON, ONS
NSU, SUN, UNS
NTO, TON, ONT
NUS, USN, SNU
OOS, OSO, SOO
OOT, OTO, TOO
OPS, PSO, SOP
OPT, PTO, TOP
OSS, SSO, SOS
OTR, TRO, ROT
OTS, TSO, SOT
OUS, USO, SOU
PPS, PSP, SPP
PSR, SRP, RPS
PSS, SSP, SPS
PST, STP, TPS
PSU, SUP, UPS
PTS, TSP, SPT
PTT, TTP, TPT
PUS, USP, SPU
RSS, SSR, SRS
RSU, SUR, URS
RSV, SVR, VRS
SST, STS, TSS
SSU, SUS, USS
YSO, SOY, OYS</pre>
=={{header|Python}}==
|