import sys input = sys.stdin.readline mod=998244353 def calc(x): S=str(x) SUM=0 now=0 for s in S: SUM+=int(s) if int(s)>=now: pass else: return False now=int(s) if len(S)==1: return True else: if calc(SUM)==True: return True else: return False def monotonic(x): S=str(x) now=0 for s in S: if int(s)>=now: pass else: return False now=int(s) return True def nextmonotonic(x): if monotonic(x)==True: return x S=str(x) L=list(map(int,list(S))) XL=L[:] flag=0 for i in range(1,len(L)): if flag==1: L[i]=L[i-1] else: if L[i]