using System;
using System.IO;
using System.Text.RegularExpressions;
public class Test
{
public static void Main()
{
var s = "Line1\rLine2\r\nLine3";
var res = Regex.Replace(s, "\r(?!\n)", "\r\n");
Console.WriteLine(res.Replace("\r","CR").Replace("\n","LF\n"));
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uSU87CnVzaW5nIFN5c3RlbS5UZXh0LlJlZ3VsYXJFeHByZXNzaW9uczsKCnB1YmxpYyBjbGFzcyBUZXN0CnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKCXsKCQl2YXIgcyA9ICJMaW5lMVxyTGluZTJcclxuTGluZTMiOwogICAgICAgIHZhciByZXMgPSBSZWdleC5SZXBsYWNlKHMsICJccig/IVxuKSIsICJcclxuIik7CiAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUocmVzLlJlcGxhY2UoIlxyIiwiQ1IiKS5SZXBsYWNlKCJcbiIsIkxGXG4iKSk7Cgl9Cn0=