#!/usr/bin/perl -w

use v5.16;

chomp (my $data = <>);

my @min;
my $count = 25*6;
my @p;
for my $l ($data =~ /.{$count}/g) {
	my @px = split //, $l;
	my @p1;
	for (@px) {
		my $p0 = shift @p;
		push @p1, !defined $p0 || $p0 == 2 ? $_ : $p0;
	}
	@p = @p1;
	say "---";
}

my $i = 0;
for (@p) {
	print $_ ? '#' : ' ';
	print "\n" if ++$i % 25 == 0;
}
