#include <iostream>
enum class COLOR
{
Blue,
Red,
Green,
Purple,
First=Blue,
Last=Purple
};
inline COLOR operator++( COLOR& x ) { return x = (COLOR)(std::underlying_type<COLOR>::type(x) + 1); }
COLOR operator*(COLOR c) {return c;}
COLOR begin(COLOR r) {return COLOR::First;}
COLOR end(COLOR r) {COLOR l=COLOR::Last; return ++l;}
std::ostream& operator<<(std::ostream& o, COLOR x) {
return o << std::underlying_type<COLOR>::type(x);
}
int main() {
for(auto c : COLOR()) {
std::cout << c << '\n';
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgplbnVtIGNsYXNzIENPTE9SCnsKICAgIEJsdWUsCiAgICBSZWQsCiAgICBHcmVlbiwKICAgIFB1cnBsZSwKICAgIEZpcnN0PUJsdWUsCiAgICBMYXN0PVB1cnBsZQp9OwoKaW5saW5lIENPTE9SIG9wZXJhdG9yKysoIENPTE9SJiB4ICkgeyByZXR1cm4geCA9IChDT0xPUikoc3RkOjp1bmRlcmx5aW5nX3R5cGU8Q09MT1I+Ojp0eXBlKHgpICsgMSk7IH0KQ09MT1Igb3BlcmF0b3IqKENPTE9SIGMpIHtyZXR1cm4gYzt9IApDT0xPUiBiZWdpbihDT0xPUiByKSB7cmV0dXJuIENPTE9SOjpGaXJzdDt9CkNPTE9SIGVuZChDT0xPUiByKSAgIHtDT0xPUiBsPUNPTE9SOjpMYXN0OyByZXR1cm4gKytsO30KCnN0ZDo6b3N0cmVhbSYgb3BlcmF0b3I8PChzdGQ6Om9zdHJlYW0mIG8sIENPTE9SIHgpIHsKCXJldHVybiBvIDw8IHN0ZDo6dW5kZXJseWluZ190eXBlPENPTE9SPjo6dHlwZSh4KTsKfQoKCmludCBtYWluKCkgeyAKICAgIGZvcihhdXRvIGMgOiBDT0xPUigpKSB7CiAgICAgICAgc3RkOjpjb3V0IDw8IGMgPDwgJ1xuJzsKICAgIH0KICAgIHJldHVybiAwOwp9