4 of 5 added 2 characters in body

Perl, 47 45 43 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