using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (a, b) = (c[0], c[1]); if (b % 3 == 2) { WriteLine($"{-a} {-a}"); } else if (b % 3 == 0) { WriteLine($"0 {a}"); } else { WriteLine($"{a} 0"); } } }