The detection algorithm is identical. The only difference is what you do after: run bipartite detection with BFS. If you find a conflict, print "IMPOSSIBLE". If no conflict, the color array already contains the partition,print it.
You do not need to compute anything extra. The color array is the answer. You have been building it all along. Translate color to team and color to team when printing the output.