#!/usr/bin/perl
use strict;
use warnings;
use v5.24;
my @Arr = ('1.1', '2.4.5', '1.1.1', '3.4');
my %Tmp = ();
foreach my $i (@Arr) {
$Tmp{$i} = '*';
my $j = $i;
while ($j =~ /^(.+).\d/) {
$j = $1;
$Tmp{$j} = '*';
}
}
IyEvdXNyL2Jpbi9wZXJsCgp1c2Ugc3RyaWN0Owp1c2Ugd2FybmluZ3M7CnVzZSB2NS4yNDsKCm15IEBBcnIgPSAoJzEuMScsICcyLjQuNScsICcxLjEuMScsICczLjQnKTsKbXkgJVRtcCA9ICgpOwoKZm9yZWFjaCBteSAkaSAoQEFycikgewogICRUbXB7JGl9ID0gJyonOwogIG15ICRqID0gJGk7CiAgd2hpbGUgKCRqID1+IC9eKC4rKS5cZC8pIHsKICAgICRqID0gJDE7CiAgICAkVG1weyRqfSA9ICcqJzsKICB9Cn0KCm15IEBSZXMgPSBzb3J0IHtyZXR1cm4gKGxlbmd0aCgkYSkgPT0gbGVuZ3RoKCRiKSkgPyAkYSBjbXAgJGIgOiBsZW5ndGgoJGIpIDw9PiBsZW5ndGgoJGEpfSBrZXlzICVUbXA7Cm1hcCB7c2F5ICRfIH0gQFJlczs=