#!/usr/bin/env python3 from sys import argv b = [int(x.replace("F", "0").replace("B", "1").replace("L", "0").replace("R", "1"), 2) for x in open(argv[1])] ok2 = 0 for x in range(min(b), max(b)+1): if x not in b: ok2 = x break print(max(b)) print(ok2)