#!/usr/bin/perl use v5.35.0; while (<>) { chomp; say; for my $step (1 .. 25) { s{(?:(0)|((?:\d\d)+)|(\d+))\b}{ if (defined($1)) {'1'} elsif (defined($2)) { my $h = length($2) / 2; $2 =~ s/.{$h}\K/ /r =~ s/\b0+(?=\d)//r } else {$3 * 2024} }xeg; say $step, ': ', s/\b(?=\d)//g, ' (', $_, ')' } }