chomp(my $n = ); my $x2 = int($n / 2); my $amari = $n % 2; my $num; $num .= 1 foreach 2..$x2; $num = $amari ? 7 . $num : 1 . $num; print "$num\n";