alist = list(map(int,input().split())) num = alist[0]**alist[1] if num >= 100: print(num % 1000) if 0<num<100: print("%03d" % num)