#!/usr/bin/perl -w

use strict;

my @seats;
while (<>) {
	chomp;
	y/FBRL/0110/;
	my $seat =  eval "0b$_";
	$seats[$seat] = 1;
}

for (1 .. $#seats-1) {
	print $_, "\n" if $seats[$_-1] && $seats[$_+1]
		&& !$seats[$_];
}
