a,b,x = list(map(int,input().split()))

print((b//x-(a-1)//x))
a,b,x = list(map(int,input().split()))

cnt2 = b//x

cnt1 = (a-1)//x

print((cnt2-cnt1))
a, b, x = list(map(int, input().split()))
print((b // x - (a - 1) // x))

a, b, x = list(map(int, input().split()))
cnt2 = b // x
cnt1 = (a - 1) // x
print((cnt2 - cnt1))

-print((b // x - (a - 1) // x)) +cnt2 = b // x +cnt1 = (a - 1) // x +print((cnt2 - cnt1))