import java.util.*; import static java.lang.System.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int n = sc.nextInt(); sc.nextLine(); int increase = 0; boolean isFinished; boolean isFirst; boolean isDuringSearch; StringBuilder ans = new StringBuilder(); for (int i=0; i=0; j--) { if ('0'<=ar[j] & ar[j]<='9') { if (isFinished==false) { if (isFirst==true) { if (ar[j]=='9') { increase = 1; ar[j] = '0'; isDuringSearch = true; } else { ar[j]++; increase = 0; isFinished = true; } isFirst = false; } else if (isFirst==false) { if (ar[j]=='9') { ar[j] = '0'; } else if (ar[j]<'9') { ar[j]++; increase = 0; isFinished = true; } } } } else { if (isDuringSearch==true) { isFinished = true; isDuringSearch = false; if (increase==1) { ans.insert(0,'1'); } } } ans.insert(0,ar[j]); if (j==0 && isDuringSearch==true) { ans.insert(0,1); } } out.println(ans); ans.setLength(0); } } }