program ideone;
var
x : array [1..8] of integer = (8, 33, 46, 78, 92, 229, 399, 433);
y : array [1..8] of integer = (5, 24, 43, 67, 78, 133, 269, 375);
z : array [1..8] of integer = (7, 13, 27, 46, 52, 68, 78, 109);
p1 : integer = 1;
q1 : integer = 1;
r1 : integer = 1;
begin
while not ((x[p1]=y[q1]) and (y[q1]=z[r1])) do begin
if x[p1]<y[q1] then begin
p1:=p1+1;
end else if y[q1]<z[r1] then begin
q1:=q1+1;
end else if z[r1]<x[p1] then begin
r1:=r1+1;
end else begin
end;
end;
{x[p1] = y[q1] = z[r1]}
writeln (x[p1]);
end.
cHJvZ3JhbSBpZGVvbmU7CnZhciAKeCA6IGFycmF5IFsxLi44XSBvZiBpbnRlZ2VyID0gKDgsIDMzLCA0NiwgNzgsIDkyLCAyMjksIDM5OSwgNDMzKTsKeSA6IGFycmF5IFsxLi44XSBvZiBpbnRlZ2VyID0gKDUsIDI0LCA0MywgNjcsIDc4LCAxMzMsIDI2OSwgMzc1KTsKeiA6IGFycmF5IFsxLi44XSBvZiBpbnRlZ2VyID0gKDcsIDEzLCAyNywgNDYsIDUyLCA2OCwgNzgsIDEwOSk7CnAxIDogaW50ZWdlciA9IDE7CnExIDogaW50ZWdlciA9IDE7CnIxIDogaW50ZWdlciA9IDE7CgpiZWdpbgogICAgICAgIHdoaWxlIG5vdCAoKHhbcDFdPXlbcTFdKSBhbmQgKHlbcTFdPXpbcjFdKSkgZG8gYmVnaW4KICAgICAgICBpZiB4W3AxXTx5W3ExXSB0aGVuIGJlZ2luCiAgICAgICAgcDE6PXAxKzE7CiAgICAgICAgZW5kIGVsc2UgaWYgeVtxMV08eltyMV0gdGhlbiBiZWdpbgogICAgICAgIHExOj1xMSsxOwogICAgICAgIGVuZCBlbHNlIGlmIHpbcjFdPHhbcDFdIHRoZW4gYmVnaW4KICAgICAgICByMTo9cjErMTsKICAgICAgICBlbmQgZWxzZSBiZWdpbgogICAgICAgIGVuZDsKICAgICAgICBlbmQ7CiAgICAgICAge3hbcDFdID0geVtxMV0gPSB6W3IxXX0KICAgICAgICB3cml0ZWxuICh4W3AxXSk7CmVuZC4=