using System; using System.Text.RegularExpressions; class Program { static void Main() { string n = Console.ReadLine(); string a = n.Replace('7', '8'); string b = Regex.Replace(n, "[^7]", "0").Replace('7', '1'); b = "-" + Regex.Replace(b, "^0*", ""); Console.WriteLine(a + " " + b); } }