def mpo(n, z = 0): if n == 0: return 0 q, r = n // 10, n % 10 if r == 0: return mpo(q, z + 1) elif z > 0: return mpo(q, z - 1) else: return 10 * mpo(q) + r def mpo2(n): s, z = "", 0 while n > 0: r, n = n % 10, n // 10 if r == 0: z += 1 elif z > 0: z -= 1 else: s = str(r) + s return int("0" + s) def mpo3(n): s = [] for c in str(n): s.pop() if c == "0" and len(s) > 0 else s.append(c) return int("0" + "".join(s)) def mpo4(n): s = str(n) f = 0 for i in range(len(s)): v = eval(s[i]) f = 10 *f + v if v else int(f / 10) return f def mpobin(n): s = z = 0 while n > 0: if 1 & n: if z: z -= 1 else : s = 1 + (s << 1) else: z += 1 n >>= 1 return s