A, B, and C were in a line blindfolded. They each had a hat put on their heads. They knew that the hats were taken from a box of 2 red, 2 yellow, and 3 blue hats. When the blindfolds were taken off, A could see B's and C's hats, B could only see C's hat, and C could not see any hats. They made the following statements.
A:I cannot tell what color my hat is not.
B:I cannot tell what color my hat is not.
C:I can tell what color my hat is.
What color is C's hat and how does C know?