#!/usr/bin/perl -w

use v5.30;
use strict;

my %seen;
while (<>) {
	chomp;
	for my $i (0 .. length($_) - 1) {
		my $x = $_;
		substr($x, $i, 1) = '_';
		$seen{$x}++;
	}
}

for my $k (keys %seen) {
	if ($seen{$k} == 2) {
		$k =~ s/_//;
		say $k;
	}
}

