#!/usr/bin/perl -w

use strict;
use v5.30;

my $sum;
while (<>) {
	chomp;
	my ($code, $id, $csum) = /\A([a-z-]+)-(\d+)\[([a-z]{5})\]/;
	my $d;
	$code =~ s/-/ /g;
	for (split //, $code) {
		if ($_ eq ' ') {
			$d .= ' ';
			next;
		}
		$d .= chr(ord('a') + ((ord($_)-ord('a')+$id) % 26));
	}
	say $id if $d =~ /pole/;
}
