number-maze

Ranjit wants to design a algorithm such that, if he enters two numbers, all the numbers between these two numbers are listed(except the number divisible by 5 & 3).

BUT the number divisible by both 3 & 5 is also listed (example 30)
The Numbers should be separated by a "," sign

Example- if the two numbers added are- 25 & 44. 

Then the output should be- 26,28,29,30,31,32,34,37,38,41,43

SAMPLE INPUT
25 44

SAMPLE OUTPUT
26,28,29,30,31,32,34,37,38,41,43

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
alls = []
a, b = list(map(int, input().split()))
for  x in range(a+1, b):
	if x%15 == 0:
		alls.append(x)
	elif x%5==0:
		continue
	elif x % 3 ==0:
		continue
	else:
		alls.append(x)
print(",".join(map(str,alls)))		
		


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
s=input()
s=s.split()
x=int(s[0])
y=int(s[1])
o=""
b=[]

if(x>y):
	temp=x
	x=y
	y=temp

for i in range (x+1,y):
	if i%5==0 or i%3==0:
		if i%5==0 and i%3==0:
			o+=str(i)+","
	else:	
		o+=str( i)+","
print(o[:-1])


n,m = list(map(eval, input().split()))
arr =[]
for i in range(n+1,m):
	if(not ((i%5!=0 and i%3==0) or (i%5==0 and i%3!=0))):
		arr.append(str(i))

print(','.join(arr))
		


a = list(map(int, input().split()))
outt=[]
for i in range(a[0]+1,a[1]):
	if i%3==0 and i%5==0:
		outt.append(i)
	elif i%3==0 or i%5==0:
		pass
	else:
		outt.append(i)
print(','.join(map(str, outt)))



import sys
result=list()
tlist=[ int(x) for x in input().split(' ')]
for i in range (tlist[0]+1,tlist[1]):
	if i%3==0 and i%5==0:
		result.append(i)
	elif i%3>0 and i%5>0:
		result.append(i)

for i in range (0,len(result)):
	if i!=len(result)-1:
		sys.stdout.write(str(result[i])+",")
	else:
		sys.stdout.write(str(result[i]))