#!/usr/bin/perl -w

use strict;
use v5.30;

my %h;
while (<>) {
	chomp;
	my $i = 0;
	for my $l (split //) {
		$h{$i++}{$l}++;
	}
}

my $p;

for my $i (0..7) {
	my @a = sort { $h{$i}{$b} <=> $h{$i}{$a} } keys %{ $h{$i} };
	$p .= $a[0];
}

say $p;
		
		
