#P7869. 「Wdoi-4」使用三个系统程度的能力

    ID: 8925 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 1 上传者: 标签>字符串2021洛谷原创基础算法枚举洛谷月赛

「Wdoi-4」使用三个系统程度的能力

Background

Erratum: In fact, since MacOS X\text{MacOS X} released in 20012001, the newline character has been \n\verb!\n!. Many articles published online contain mistakes; the problem setter also believed them without checking in person. To prevent rumors from spreading further, this paragraph is placed here. The testdata still follows the current problem statement and has not been changed.


Hecatia Lapislazuli is a goddess with three bodies, ruling the hells of the Moon, the Earth, and the Otherworld. Because she formed an alliance with Junko, Hecatia came into contact with Gensokyo, as well as some modern technology.

Hecatia found that in human society there are three very common and popular operating systems: Windows\text{Windows}, Linux\text{Linux}, and Mac\text{Mac}. These three are like Hecatia’s three bodies, each taking a large share of the market.

But Hecatia also found that although files can be exchanged between these three systems in some ways, there are still differences—for example, the characters used for newlines. Hecatia is very interested in this.

Now Hecatia somehow got a text file from some system. She wants to know on which system this file was edited. Can you write a program to help her?

Problem Description

On Windows\text{Windows}, Linux\text{Linux}, and Mac\text{Mac} systems, three different newline conventions are used. Written as explicit escape sequences, they are \r\n\verb!\r\n!, \n\verb!\n!, and \r\verb!\r!. Now there is a non-empty text file that has already been written (it contains only uppercase and lowercase English letters, underscores, Arabic digits, spaces, and newlines). This text file was written on a single system, so it is guaranteed that the newline sequences appear in only one of the three forms above.

For example, this is a valid text file:

SCP2021 J rp plus plus
chen zhe AK IOI

Welcome to Hell

Now replace its newlines with the corresponding escape sequences. Then, on the three systems, it would look like the following:

  • Windows\text{Windows} system:
$$\colorbox{f5f5f5}{\verb!SCP2021 J rp plus plus\r\nchen zhe AK IOI\r\n\r\nWelcome to Hell!}$$
  • Linux\text{Linux} system:
$$\colorbox{f5f5f5}{\verb!SCP2021 J rp plus plus\nchen zhe AK IOI\n\nWelcome to Hell!\kern{31.5pt}}$$
  • Mac\text{Mac} system:
$$\colorbox{f5f5f5}{\verb!SCP2021 J rp plus plus\rchen zhe AK IOI\r\rWelcome to Hell!\kern{31.5pt}}$$

Your task is: given the converted text file, determine on which system this text file was written. For the three cases above, output windows, linux, or mac, respectively.

Input Format

There is one line of input: the converted text file. The text file is guaranteed to be non-empty, and before conversion it contains at least one newline. The input may contain spaces.

Output Format

Output one line with one lowercase word, indicating on which system this text file was written.

SCP2021RPplusplus\nchenzheAKIOI\n1plus1equalto2\n
linux
chen_zhe AK IOI\r\nchen_zhe AK NOI\r\n
windows
include iostream\rsigned main return 0\r
mac

Hint

Sample 44 can be found in the attached files system4.in/system4.out\textbf{\textit{system4.in}/\textit{system4.out}}.

Constraints

  • For 40%40\% of the testdata, it is guaranteed that there are no spaces.
  • For 100%100\% of the testdata, the input string length is guaranteed to be 105\le 10^5. The input contains only uppercase English letters, lowercase English letters, underscores, digits, spaces, and escape characters (\r, \n).

Note

In this problem, \n and \r mean a backslash character directly written in the input followed by a lowercase letter n or r, rather than a real escape character.

Translated by ChatGPT 5