{$O-,Q+,R+}
uses SysUtils;
var n, p1, p2, p3, p4, i : integer;
begin
  n := strtoint (paramstr (1));
  p1 := strtoint (paramstr (2));
  p2 := strtoint (paramstr (3));
  p3 := strtoint (paramstr (4));
  p4 := strtoint (paramstr (5));
  randseed := strtoint (paramstr (6));
  for i := 1 to n do
    write (chr (ord (random (p2) < p1) + 48));
  writeln;
  for i := 1 to n do
    write (chr (ord (random (p4) < p3) + 48));
  writeln;
end.