// yukicoder: No.504 ゲーム大会(ランキング) // 2019.4.18 bal4u #include #if 1 #define gc() getchar_unlocked() #define pc(c) putchar_unlocked(c) #else #define gc() getchar() #define pc(c) putchar(c) #endif int in() { int n = 0, c = gc(); do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0'); return n; } char ans[6] = "000001", *top = ans+5, *end = ans+5; void outs() { char *s = top; while (*s) pc(*s++); pc('\n'); } void inc(char *p) { if (p < top) top = p; if (*p < '9') (*p)++; else { *p = '0'; if (top == p) top--; inc(p-1); } } int main() { int N, a, a1; N = in(); a1 = in(); outs(); while (--N) { a = in(); if (a > a1) inc(end); outs(); } return 0; }