#include <stdio.h>

#define DECLARE() int state = 0

#define BEGIN switch (state) { \
                      case 0:

#define YIELD(val) do { \
                        state = __LINE__;   \
                        return val;         \
                      case __LINE__:        \
                        ;                   \
                      } while (0)

#define END }

char* next()
{
	static DECLARE();
    BEGIN;
        YIELD("мама");
        YIELD("мыла");
        YIELD("лалку");
    END;
    return 0;
}
char* kakoi()
{
	static DECLARE();
	static int i;
    BEGIN;
        YIELD("Какой ");
        YIELD("yield ");
        for (i=0;i<3;++i)
            YIELD(")");
    END;
    return 0;
}
int main()
{
	char* str;
    while (str = next()) {
        printf("%s ", str);
    }
    putchar('\n');
    while (str = kakoi()) {
        printf("%s", str);
    }
    
    return 0;
}