b,n;char**u,*t[]={"111","222","12121","21212","112211","221122","11211211","22122122",0},s[9];main(c){for(b=2;++b<9;)for(n=0;n<1<<b;++n){for(c=b;~--c;)s[b-c-1]=n&1<<c?50:49;for(u=t;*u;)if(strstr(s,*u++)){puts(s);break;}}}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).