use v6;
my $in = q[201.1 201(27,28,3,4,83,84,890,897,898,9)
201.1 2054
201.2 201(1,20-26,29,80-82,891-896,899)
201.3 201(52-54,6,75,76,85-88)
201.4 201(50,51,55-59,70-74,77-79)
202.1 202(20-24,28,29,4,75,8,90-92,94,95,97-99)
202.2 202(1,27,3,70-74,76-79,93)
202.3 202(25,26,5,6,96)
203.1 203(1-3,41-45,9)
203.1 206
203.2 203(40,46-49,5,8)
203.3 203(6,7)
2041.1 204
2051.1 2051
2051.1 2052
2051.1 2053
2051.1 2056
2051.1 2058];
for $in.lines {
my ($left, $right) = .words;
if $right ~~ /'(' (.*) ')'/ {
my $prefix = $right.substr(0, $/.from);
say "$left\t$prefix$_" for $0.split: ',';
}
else {
.say;
}
}