{"problem":{"name":"Largest Smallest Cyclic Shift","description":{"content":"For a string $S$, let $f(S)$ be the lexicographically smallest cyclic shift of $S$. For example, if $S = $ `babca`, $f(S) = $ `ababc` because this is the smallest among all cyclic shifts (`babca`, `ab","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"code_festival_2017_qualb_f"},"statements":[{"statement_type":"Markdown","content":"For a string $S$, let $f(S)$ be the lexicographically smallest cyclic shift of $S$. For example, if $S = $ `babca`, $f(S) = $ `ababc` because this is the smallest among all cyclic shifts (`babca`, `abcab`, `bcaba`, `cabab`, `ababc`).\nYou are given three integers $X, Y$, and $Z$. You want to construct a string $T$ that consists of exactly $X$ `a`s, exactly $Y$ `b`s, and exactly $Z$ `c`s. If there are multiple such strings, you want to choose one that maximizes $f(T)$ lexicographically.\nCompute the lexicographically largest possible value of $f(T)$.\n\n## Constraints\n\n*   $1 \\leq X + Y + Z \\leq 50$\n*   $X, Y, Z$ are non-negative integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$X$ $Y$ $Z$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"code_festival_2017_qualb_f","tags":[],"sample_group":[["2 2 0","abab\n\n$T$ must consist of two `a`s and two `b`s.\n\n*   If $T = $ `aabb`, $f(T) = $ `aabb`.\n*   If $T = $ `abab`, $f(T) = $ `abab`.\n*   If $T = $ `abba`, $f(T) = $ `aabb`.\n*   If $T = $ `baab`, $f(T) = $ `aabb`.\n*   If $T = $ `baba`, $f(T) = $ `abab`.\n*   If $T = $ `bbaa`, $f(T) = $ `aabb`.\n\nThus, the largest possible $f(T)$ is `abab`."],["1 1 1","acb"]],"created_at":"2026-03-03 11:01:14"}}