#include <iostream>
int LSFR()
{
static unsigned long shift_register = 1;
shift_register = ((( (shift_register >> 31)
^ (shift_register >> 6)
^ (shift_register >> 4)
^ (shift_register >> 2)
^ (shift_register >> 1)
^ shift_register)
& 0x00000001)
<< 31)
| (shift_register >> 1);
return shift_register & 0x00000001;
}
int main() {
for (int i{}; i < 500; i++) std:: cout << LSFR();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IExTRlIoKQp7CglzdGF0aWMgdW5zaWduZWQgbG9uZyBzaGlmdF9yZWdpc3RlciA9IDE7CgkKCXNoaWZ0X3JlZ2lzdGVyID0gKCgoIChzaGlmdF9yZWdpc3RlciA+PiAzMSkKCQkJCQkJIF4gKHNoaWZ0X3JlZ2lzdGVyID4+IDYpCgkJCQkJCSBeIChzaGlmdF9yZWdpc3RlciA+PiA0KQoJCQkJCQkgXiAoc2hpZnRfcmVnaXN0ZXIgPj4gMikKCQkJCQkJIF4gKHNoaWZ0X3JlZ2lzdGVyID4+IDEpCgkJCQkJCSBeIHNoaWZ0X3JlZ2lzdGVyKQoJCQkJCSAgICAgJiAweDAwMDAwMDAxKQoJCQkJCSAgICAgPDwgMzEpCgkJCQkJICAgICB8IChzaGlmdF9yZWdpc3RlciA+PiAxKTsKCQoJcmV0dXJuIHNoaWZ0X3JlZ2lzdGVyICYgMHgwMDAwMDAwMTsKfQoKaW50IG1haW4oKSB7CgoJZm9yIChpbnQgaXt9OyBpIDwgNTAwOyBpKyspIHN0ZDo6IGNvdXQgPDwgTFNGUigpOwoJCglyZXR1cm4gMDsKfQ==