#include #include using namespace std; main() { int x = (1<<10)-1, n; string s; for(;;) { cin >> n; if( !n ) break; cin >> s >> s; if( s == "high" ) x &= (1<<(n-1))-1; else if( s == "low" ) x &= (1<<10)-(1<