Multiples of X, Y and X+Y Till U: Given two numbers X and Y and an upper limit U, print multiples of X, Y and X+Y till U (not inclusive of U) in both forward and reverse directions.

Boundary Condition:
1 <= X,Y <= 100
1 <= U <= 9999999

Input Format:
The first line contains X and Y separated by a space.
The second line contains U.

Output Format:
The first line contains the multiples of X, Y and X+Y from 1 to U in forward direction.
The second line contains the multiples of X, Y and X+Y from 1 to U in reverse direction.

Example Input/Output 1:
Input:
3 6
24

Output:
3 6 9 12 15 18 21
21 18 15 12 9 6 3

Example Input/Output 2:
Input:
4 7
45

Output:
4 7 8 11 12 14 16 20 21 22 24 28 32 33 35 36 40 42 44
44 42 40 36 35 33 32 28 24 22 21 20 16 14 12 11 8 7 4

``````x,y=map(int,input().split())
u=int(input())
l=[]
for i in range(min(x,y),u):
if i%x==0 or i%y==0 or i%(x+y)==0:
l.append(i)
print(*l)
print(*l[::-1])
``````
Claps!
7
{"ft_lang_label":"__label__en","ft_lang_prob":0.58421,"math_prob":0.9816519,"size":918,"snap":"2020-45-2020-50","text_gpt3_token_len":340,"char_repetition_ratio":0.11925602,"word_repetition_ratio":0.13297872,"special_character_ratio":0.4379085,"punctuation_ratio":0.128,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98249763,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-11-30T17:24:54Z\",\"WARC-Record-ID\":\"<urn:uuid:8edd9212-6c38-48d2-9cb5-649530b2a76a>\",\"Content-Length\":\"176281\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:1d7e9354-b91c-454a-a8bf-bbcaaf397f0b>\",\"WARC-Concurrent-To\":\"<urn:uuid:8ebbd398-7dd9-442b-88b8-895b4d8994ac>\",\"WARC-IP-Address\":\"104.18.33.242\",\"WARC-Target-URI\":\"https://letuscrack.com/multiples-of-x-y-and-xy-till-u/\",\"WARC-Payload-Digest\":\"sha1:GMMCY5IC7KFIKPAA3ABXJI3XC727DN5O\",\"WARC-Block-Digest\":\"sha1:Q6ZCKK65UDFAFXPMCXS45VERV23WDNU5\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141216897.58_warc_CC-MAIN-20201130161537-20201130191537-00406.warc.gz\"}"}