## Perl, <s>47</s> <s>45</s> <s>43</s> 39 bytes

    @%=1..<>;$a=$_,say map{$a==$_|0}@%for@%

Running with the `-E` perlrun:

    $ echo 3 | perl -E'@%=1..<>;$a=$_,say map{$a==$_|0}@%for@%'
    100
    010
    001