// 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"; int top=5, end = 5; void outs() { char *s = ans+top; while (*s) pc(*s++); pc('\n'); } void inc(int p) { if (p < top) top = p; if (ans[p] < '9') ans[p]++; else ans[p] = '0', 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; }