using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; public class Program { public static void Main() { var anotherValue = string.Empty; var value = Console.ReadLine(); var a = string.Concat(value.Select(c => c == '7' ? '6' : c)); var b = string.Concat(value.Select(c => c == '7' ? '1' : '0')); Console.WriteLine(a + " " + b); } }