When they are put into their line, each prisoner can see all but a finite number of hats, and can therefore see which equivalence class the "actual" sequence of hats belongs to. (This assumes that each prisoner can perform an "uncountably infinite" number of comparisons to find a match, with each class comparison requiring a "countably infinite" number of individual hat-comparisons). They then proceed guessing their hat color as if they were in the "representative" sequence from the appropriate equivalence class. Because the actual sequence and the representative sequence are in the same equivalence class, their entries are the same after some finite number "N" of prisoners. All prisoners after these first "N" prisoners are saved.