// yukicoder: No.342 一番ワロタww // 2019.5.5 bal4u #include #define gc() getchar() #define pc(c) putchar(c) void ins(unsigned char *s) // 文字列の入力 スペース以下の文字で入力終了 { do *s = gc(); while (*s++ > ' '); *(s-1) = 0; } void outs(unsigned char *s) { while (*s) pc(*s++); } // w = 0xef 0xbd 0x97 unsigned char S[1000], *s = S; int isJW(unsigned char *s) { return *s == 0xef && *(s+1) == 0xbd && *(s+2) == 0x97; } int main() { int w, max; unsigned char *S0, *p, *q; ins(S); while (isJW(s)) s += 3; S0 = s; max = 0; while (1) { w = 0; while (isJW(s)) s += 3, w++; if (w > max) max = w; if (*s++ == 0) break; } if (max == 0) { pc('\n'); return 0; } s = S0, p = s; while (1) { if (isJW(s)) { q = s; w = 0; while (isJW(s)) s += 3, w++; if (w == max) { *q = 0, outs(p), pc('\n'); } p = s; } if (*s++ == 0) break; } return 0; }