number, count = map(int, input().split()) choise_number = 10 ** 10 number = number ** count print(choise_number) print(number%choise_number)