#include <bits/stdc++.h>
using namespace std;
#define loop(a) for(a='0';a<='1';a++)
int main()
{
char a,b,c,d,e;
int cnt=0;
loop(a)
loop(b)
loop(c)
loop(d)
loop(e)
{
string s; s+=a; s+=b; s+=c; s+=d; s+=e;
if(s.find("101")==string::npos) cout<<s<<" ",cnt++;
}
cout<<cnt<<"\n";
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIGxvb3AoYSkgZm9yKGE9JzAnO2E8PScxJzthKyspCmludCBtYWluKCkKewoJY2hhciBhLGIsYyxkLGU7CglpbnQgY250PTA7Cglsb29wKGEpCgkJbG9vcChiKQoJCQlsb29wKGMpCgkJCQlsb29wKGQpCgkJCQkJbG9vcChlKQoJCQkJCXsKCQkJCQkJc3RyaW5nIHM7IHMrPWE7IHMrPWI7IHMrPWM7IHMrPWQ7IHMrPWU7CgkJCQkJCWlmKHMuZmluZCgiMTAxIik9PXN0cmluZzo6bnBvcykJY291dDw8czw8IiAiLGNudCsrOwoJCQkJCX0KCQkJCQkKCWNvdXQ8PGNudDw8IlxuIjsKfQ==