#pragma GCC diagnostic ignored "-Wunused-result" #pragma GCC optimize "Ofast" #include #include #include #include const int32_t exp[] = { 100000, 10000, 1000, 100, 10, 1 }; uint8_t c, ostr[1000000], *optr = ostr; int64_t n = 0; int main() { fseek(stdin, 0, 2); int64_t istrlen = ftell(stdin); uint8_t *istr = (uint8_t*)malloc(istrlen), *iptr = istr; fseek(stdin, 0, 0); fread(istr, 1, istrlen, stdin); while ((c = *iptr++) >= '0') n = n * 10 + (c - '0'); for (int64_t i = 2; i <= n; ) { if (*(int16_t*)iptr == 0x6F78) { iptr += 2; if (i == 100000) { memcpy(optr, "100000", 6); optr += 6; } if (i > 9999) { for (uint8_t j = 0; j < 5; ++j) *optr++ = i % exp[j] / exp[j + 1] + '0'; } else if (i > 999) { for (uint8_t j = 1; j < 5; ++j) *optr++ = i % exp[j] / exp[j + 1] + '0'; } else if (i > 99) { for (uint8_t j = 2; j < 5; ++j) *optr++ = i % exp[j] / exp[j + 1] + '0'; } else if (i > 9) { for (uint8_t j = 3; j < 5; ++j) *optr++ = i % exp[j] / exp[j + 1] + '0'; } else { *optr++ = i + '0'; } *optr++ = ' '; i += 2; } else { ++i; ++iptr; } } fwrite(ostr, 1, optr - ostr, stdout); return 0; }