#!/usr/bin/env perl
# idea:
#   HAS to be O(N) because have to check each item in worst case
use strict;
use warnings;

my %seen;
while (<>) {
    chomp;
    my $comp = 2020 - $_;
    if (exists $seen{$comp}) {
        print $_ * $comp . "\n";
        exit(0);
    } else {
        $seen{$_} = 1;
    }
}
exit(1);
