d,l,r,k=map(int,input().split()) TWO=[2**i for i in range(23)] mod=10**9+7 FACT=[1] for i in range(1,(1<