def main(): N = int(input()) X = list(map(int, input().split())) Y = list(map(int, input().split())) length = -1 for i in range(N): if X[i] == Y[i] == 0: length = 0 break if X[i] == Y[i] == 1: length = 2 if length == -1: length = min(X) + min(Y) + 1 print(length) print(0) for i in range(N): if length == 0: print(0) else: print(min(X[i],Y[i])) print(0 + length) if __name__ == "__main__": main()