#!/usr/bin/perl -w

use strict;
use v5.30;

$; = ',';
my %pos2num = (
	"2,0" => 1,
	"1,1" => 2,
	"2,1" => 3,
	"3,1" => 4,
	"0,2" => 5,
	"1,2" => 6,
	"2,2" => 7,
	"3,2" => 8,
	"4,2" => 9,
	"1,3" => 'A',
	"2,3" => 'B',
	"3,3" => 'C',
	"2,4" => 'D',
);
my @pos = (0, 2);
my $ret = '';
while (<>) {
	chomp;
	for my $step (split //) {
		$pos[0]-- if $pos2num{ ($pos[0]-1).",$pos[1]" } && $step eq 'L';
		$pos[0]++ if $pos2num{ ($pos[0]+1).",$pos[1]" } && $step eq 'R';
		$pos[1]-- if $pos2num{ "$pos[0],".($pos[1]-1) } && $step eq 'U';
		$pos[1]++ if $pos2num{ "$pos[0],".($pos[1]+1) } && $step eq 'D';
	}
	$ret .= $pos2num{$pos[0],$pos[1]};
}

say $ret;

