#!/usr/bin/env perl use strict; use warnings; use bigint; my ($m, $n) = split / /, <>; for(my $i = $m; $i <= $n; $i++ ) { if($i % 3 == 0) { print "$i\n"; } else { my @array = split //, $i; for(my $j = 0; $j < $#array + 1; $j++) { if($array[$j] eq '3') { print "$i\n"; last; } } } } exit;