{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tTeX is a typesetting language developed by Donald \u003cspan data-scayt_word\u003d\"Knuth\" data-scaytid\u003d\"2\"\u003eKnuth\u003c/span\u003e. It takes source text together with a few typesetting instructions and produces, one hopes, a beautiful document. Beautiful documents use `` and \u0026quot; to delimit quotations, rather than the mundane \u003ctt\u003e\u0026quot;\u003c/tt\u003e which is what is provided by most keyboards. Keyboards typically do not have an oriented double-quote, but they do have a left-single-quote \u003ctt\u003e`\u003c/tt\u003e and a right-single-quote \u003ctt\u003e\u0026#39;\u003c/tt\u003e. Check your keyboard now to locate the left-single-quote key \u003ctt\u003e`\u003c/tt\u003e (sometimes called the ``\u003cspan data-scayt_word\u003d\"backquote\" data-scaytid\u003d\"3\"\u003ebackquote\u003c/span\u003e key\u0026quot;) and the right-single-quote key \u003ctt\u003e\u0026#39;\u003c/tt\u003e (sometimes called the ``apostrophe\u0026quot; or just ``quote\u0026quot;). Be careful not to confuse the left-single-quote \u003ctt\u003e`\u003c/tt\u003e with the ``backslash\u0026quot; key \u003ccode\u003e\\\u003c/code\u003e. \u003cspan data-scayt_word\u003d\"TeX\" data-scaytid\u003d\"4\"\u003eTeX\u003c/span\u003e lets the user type two left-single-quotes \u003ctt\u003e``\u003c/tt\u003e to create a left-double-quote `` and two right-single-quotes \u003ctt\u003e\u0026#39;\u0026#39;\u003c/tt\u003e to create a right-double-quote \u0026#39;\u0026#39;. Most typists, however, are accustomed to delimiting their quotations with the un-oriented double-quote \u003ctt\u003e\u0026quot;\u003c/tt\u003e.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tIf the source contained\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003ctt\u003e\u0026quot;To be or not to be,\u0026quot; quoth the bard, \u0026quot;that is the question.\u0026quot;\u003c/tt\u003e\u003c/p\u003e\r\n\u003cp\u003e\r\n\tthen the typeset document produced by TeX would not contain the desired form:\u003c/p\u003e\r\n\u003cp\u003e\r\n\t``To be or not to be,\u0026quot; quoth the bard, ``that is the question.\u0026quot;\u003c/p\u003e\r\n\u003cp\u003e\r\n\tIn order to produce the desired form, the source file must contain the sequence:\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003ctt\u003e``To be or not to be,\u0026#39;\u0026#39; quoth the bard, ``that is the question.\u0026#39;\u0026#39;\u003c/tt\u003e\u003c/p\u003e\r\n\u003cp\u003e\r\n\tYou are to write a program which converts text containing double-quote (\u003ctt\u003e\u0026quot;\u003c/tt\u003e) characters into text that is identical except that double-quotes have been replaced by the two-character sequences required by \u003cspan data-scayt_word\u003d\"TeX\" data-scaytid\u003d\"8\"\u003eTeX\u003c/span\u003e for delimiting quotations with oriented double-quotes. The double-quote (\u003ctt\u003e\u0026quot;\u003c/tt\u003e) characters should be replaced appropriately by either \u003ctt\u003e``\u003c/tt\u003e if the \u003ctt\u003e\u0026quot;\u003c/tt\u003e opens a quotation and by \u003ctt\u003e\u0026#39;\u0026#39;\u003c/tt\u003e if the \u003ctt\u003e\u0026quot;\u003c/tt\u003e closes a quotation. Notice that the question of nested quotations does not arise: The first \u003ctt\u003e\u0026quot;\u003c/tt\u003e must be replaced by \u003ctt\u003e``\u003c/tt\u003e, the next by \u003ctt\u003e\u0026#39;\u0026#39;\u003c/tt\u003e, the next by \u003ctt\u003e``\u003c/tt\u003e, the next by \u003ctt\u003e\u0026#39;\u0026#39;\u003c/tt\u003e, the next by \u003ctt\u003e``\u003c/tt\u003e, the next by \u003ctt\u003e\u0026#39;\u0026#39;\u003c/tt\u003e, and so on.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tInput will consist of several lines of text containing an even number of double-quote (\u003ctt\u003e\u0026quot;\u003c/tt\u003e) characters. Input is ended with an end-of-file character.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tThe text must be output exactly as it was input except that:\u003c/p\u003e\r\n\u003cul\u003e\r\n\t\u003cli\u003e\r\n\t\tthe first\u0026nbsp;\u003ctt\u003e\u0026quot;\u003c/tt\u003e\u0026nbsp;in each pair is replaced by two\u0026nbsp;\u003ctt\u003e`\u003c/tt\u003e\u0026nbsp;characters:\u0026nbsp;\u003ctt\u003e``\u003c/tt\u003e\u0026nbsp;and\u003c/li\u003e\r\n\t\u003cli\u003e\r\n\t\tthe second\u0026nbsp;\u003ctt\u003e\u0026quot;\u003c/tt\u003e\u0026nbsp;in each pair is replaced by two\u0026nbsp;\u003ctt\u003e\u0026#39;\u003c/tt\u003e\u0026nbsp;characters:\u0026nbsp;\u003ctt\u003e\u0026#39;\u0026#39;\u003c/tt\u003e.\u003c/li\u003e\r\n\u003c/ul\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e\r\n\u0026quot;To be or not to be,\u0026quot; quoth the Bard, \u0026quot;that\r\nis the question\u0026quot;.\r\nThe programming contestant replied: \u0026quot;I must disagree.\r\nTo `C\u0026#39; or not to `C\u0026#39;, that is The Question!\u0026quot;\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e\r\n``To be or not to be,\u0026#39;\u0026#39; quoth the Bard, ``that\r\nis the question\u0026#39;\u0026#39;.\r\nThe programming contestant replied: ``I must disagree.\r\nTo `C\u0026#39; or not to `C\u0026#39;, that is The Question!\u0026#39;\u0026#39;\u003c/pre\u003e"}}]}