Given an integer n, write a function that returns the sequence of outputs produced by three coordinated threads printing numbers from 1 to n. Thread A prints numbers where num % 3 == 1, Thread B prints numbers where num % 3 == 2, and Thread C prints numbers where num % 3 == 0. The final output must be in exact order from 1 to n.
def print_sequence_three_threads(n):