To print the sequence BCABCABCA..., the execution must strictly follow the cyclic order T2→T1→T3→T2…
First character 'B':
Thread T2 prints 'B' after executing wait(S1).
For T2 to execute first without allowing other threads to interleave, we must initialize S1=1.
If either S2=1 or S3=1 initially, thread T3 (prints 'A') or T1 (prints 'C') could run first or concurrently, violating the required sequence. Thus, we must have S2=0 and S3=0.
Tracing execution with S1=1,S2=0,S3=0:
T2 runs:wait(S1) sets S1=0, prints "B", and signal(S3) sets S3=1.
T1 runs:wait(S3) sets S3=0, prints "C", and signal(S2) sets S2=1.
T3 runs:wait(S2) sets S2=0, prints "A", and signal(S1) sets S1=1.
The cycle repeats indefinitely, generating the output BCABCABCA... strictly.
Thus, the correct initialization is S1=1;S2=0;S3=0, which corresponds to Option (C).