#K2401. File Naming Convention Validation
File Naming Convention Validation
File Naming Convention Validation
Given a file name string, check if it adheres to the naming convention. The file name must be exactly 6 characters long and must contain exactly one occurrence each of the characters A
and a
, one occurrence each of B
and b
, and one occurrence each of C
and c
. The letters can appear in any order. In other words, if you denote the string by \(S\), the following conditions must hold:
[ |S| = 6, \quad \text{and} \quad \forall (U, L) \in {(A, a), (B, b), (C, c)}: ; \text{count}(U, S)=1 ; \text{and} ; \text{count}(L, S)=1. ]
If these conditions are satisfied, the file name is VALID
; otherwise, it is INVALID
.
inputFormat
The input consists of a single line containing a string \(S\) that represents the file name.
outputFormat
Output a single line: VALID
if the file name adheres to the convention, otherwise INVALID
.
AaBbCc
VALID