d,l,r,k = map(int,input().split()) mod = 10**9+7 ans = 0 depl = len(bin(l))-3 depr = len(bin(r))-3 fact = [1]*((1<