{"problem":{"name":"[CCC 2008 J2] Do the Shuffle","description":{"content":"Those tiny music machines that play your digital music are really computers that keep track of and play music files. The CCC music player $(C^3MP)$ is currently in development and will be hitting the ","description_type":"Markdown"},"platform":"Luogu","limit":{"time_limit":1000,"memory_limit":131072},"difficulty":{"LuoguStyle":"P1"},"is_remote":true,"is_sync":true,"sync_url":null,"sign":"LGP9855"},"statements":[{"statement_type":"Markdown","content":"Those tiny music machines that play your digital music are really computers that keep track of and play music files. The CCC music player $(C^3MP)$ is currently in development and will be hitting the stores soon! In this problem, you have to simulate a $C^3MP$.\n\nThe $C^3MP$ music player will hold $5$ songs in memory, whose titles will always be `A`, `B`, `C`, `D`, `E`. The $C^3MP$ also keeps track of a playlist, which is an ordering of all the songs. The $C^3MP$ has 4 buttons that the user will press to rearrange the playlist and play the songs.\n\nInitially, the $C^3MP$ playist is `A,B,C,D,E`. The $4$ control buttons do the following:\n\n- button $1$: move the first song of the playlist to the end of the playlist. For example: `A,B,C,D,E` will change to `B,C,D,E,A`.\n\n- button $2$: move the last song of the playlist to the start of the playlist. For example, `A,B,C,D,E` will change to `E,A,B,C,D`.\n\n- button $3$: swap the first two songs of the playlist. For example, `A,B,C,D,E` will change to `B,A,C,D,E`.\n\n- button $4$: stop rearranging songs and output the playlist.\n\n## Input\n\nYou need to write a program to simulate a CCC music player. Your program should repeatedly ask for two positive integers b and n. Here b represents the button number that the user wants to press, $1 \\leq b \\leq 4$, and n represents the number of times that the user wants to press button b. You can assume that n always satisfies $1 \\leq n \\leq 10$.\n\n## Output\n\nThe input will always finish with the pair of inputs $(b = 4, n = 1)$ when this happens, you should print the order of songs in the current playlist and your program should end. You can assume that the user will only ever press button $4$ once.\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"LGP9855","tags":["2008","CCC（加拿大）"],"sample_group":[["2\n1\n3\n1\n2\n3\n4\n1","B C D A E"]],"created_at":"2026-03-03 11:09:25"}}