using System; using System.Linq; using System.Collections.Generic; class No6 { static void Main() { var line = Console.ReadLine().Split(' ').Select(n => Int64.Parse(n)).ToArray(); var k = Console.ReadLine().Split(' ').Select(n => Int64.Parse(n)).ToArray(); var list = new List(); var x = line[0]; while (line[1] > 1) { x = x * x % 1000003; if (line[1] % 2 == 1) list.Add(x); line[1] /= 2; } foreach (var l in list) { x = x * l % 1000003; } Console.WriteLine(x); } }