n = int(input()) a = input().split() t = "".join(s[2:] for s in a) s = bin(int(t, 16))[2:] s = '0' * (len(t) * 4 - len(s)) + s s = s[:n] c = s.count('0') if c == 0: print(0) exit() A = [] for o inrange(1, n): cnt = 0 for i inrange(o, n): if s[i] == '0'and s[i - o] == '1': cnt += 1 if cnt == c: t = s[o:] + '1' * o t = t.replace('0', '2').replace('1', '0').replace('2', '1') A.append((o, t)) break for o inrange(1, n): cnt = 0 for i inrange(n - o): if s[i] == '0'and s[i + o] == '1': cnt += 1 if cnt == c: t = '1' * o + s[:n - o] t = t.replace('0', '2').replace('1', '0').replace('2', '1') A.append((-o, t)) break print(len(A)) for k, v in A: print("{:+}".format(k)) print(v)
input() s = input() a = s.split('+') m = 0 for i inrange(len(a)): p = a[i].find('.') if p != -1: m = max(m, len(a[i]) - p - 1) for i inrange(len(a)): p = a[i].find('.') if p == -1: a[i] = a[i] + m * '0' else: n = len(a[i]) a[i] = a[i].replace('.', '') + '0' * (m - (n - p - 1))
for i inrange(len(a)): a[i] = list(a[i][::-1])
x, y = a[0], a[1] iflen(x) > len(y): x, y = y, x x = x + list('0'for i inrange(len(y) - len(x))) n = len(y) c = 0 a = [] mp = {'!!': 0, '!@': 13, '@!': 13, '@@': 7, '!#': 4, '#!': 4, '@#': 20, '#@': 20, '##': 5} for i inrange(n): if x[i].isdigit(): w = int(x[i]) + int(y[i]) + c c, w = divmod(w, 10) a.append(w) else: w = mp[x[i] + y[i]] + c c, w = divmod(w, 10) a.append(w) if c: a.append(c) whilelen(a) > m and a[-1] == 0: a.pop() if m != 0: a = a[:m] + ['.'] + a[m:] p = 0 while p < len(a) and a[p] == 0: p += 1 a = a[p:] s = "".join(str(x) for x inreversed(a)) iflen(s) == 0: s = '0' else: if s[0] == '.': s = '0' + s if s[-1] == '.': s = s[:-1] print(s)