{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":" Music Macro Language (MML) is a language for textual representation of musical scores. Although there are various dialects of MML, all of them provide a set of commands to describe scores, such as commands for notes, rests, octaves, volumes, and so forth. In this problem, we focus on rests, i.e. intervals of silence. Each rest command consists of a command specifier \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003eR\u003c/pre\u003e\u0027 followed by a duration specifier. Each duration specifier is basically one of the following numbers: \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e1\u003c/pre\u003e\u0027, \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e2\u003c/pre\u003e\u0027, \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e4\u003c/pre\u003e\u0027, \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e8\u003c/pre\u003e\u0027, \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e16\u003c/pre\u003e\u0027, \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e32\u003c/pre\u003e\u0027, and \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e64\u003c/pre\u003e\u0027, where \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e1\u003c/pre\u003e\u0027 denotes a whole (1), \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e2\u003c/pre\u003e\u0027 a half (1/2), \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e4\u003c/pre\u003e\u0027 a quarter (1/4), \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e8\u003c/pre\u003e\u0027 an eighth (1/8), and so on. This number is called the \u003ci\u003ebase duration\u003c/i\u003e, and optionally followed by one or more dots. The first dot adds the duration by the half of the base duration. For example, \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e4.\u003c/pre\u003e\u0027 denotes the duration of \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e4\u003c/pre\u003e\u0027 (a quarter) plus \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e8\u003c/pre\u003e\u0027 (an eighth, i.e. the half of a quarter), or simply 1.5 times as long as \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e4\u003c/pre\u003e\u0027. In other words, \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003eR4.\u003c/pre\u003e\u0027 is equivalent to \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003eR4R8\u003c/pre\u003e\u0027. In case with two or more dots, each extra dot extends the duration by the half of the previous one. Thus \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e4..\u003c/pre\u003e\u0027 denotes the duration of \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e4\u003c/pre\u003e\u0027 plus \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e8\u003c/pre\u003e\u0027 plus \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e16\u003c/pre\u003e\u0027, \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e4...\u003c/pre\u003e\u0027 denotes the duration of \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e4\u003c/pre\u003e\u0027 plus \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e8\u003c/pre\u003e\u0027 plus \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e16\u003c/pre\u003e\u0027 plus \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e32\u003c/pre\u003e\u0027, and so on. The duration extended by dots cannot be shorter than \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e64\u003c/pre\u003e\u0027. For exapmle, neither \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e64.\u003c/pre\u003e\u0027 nor \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e16...\u003c/pre\u003e\u0027 will be accepted since both of the last dots indicate the half of \u0027\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003e64\u003c/pre\u003e\u0027 (i.e. the duration of 1/128). In this problem, you are required to write a program that finds the shortest expressions equivalent to given sequences of rest commands. \u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eInput\u003c/b\u003e\u003c/div\u003eThe input consists of a line containing a non-empty sequence of valid rest commands. You may assume that the sequence does not contain more than 100000 characters. \u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/div\u003eYour program should output the shortest expression in one line. If there are multiple expressions of the shortest length, output the lexicographically smallest one. \u003cbr\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eR2R2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eR1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Sample 2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eR1R2R4R8R16R32R64\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eR1......\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Sample 3","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eR1R4R16\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eR16R1R4\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}