Problem:


Structured Programming

In programming languages like C/C++, a goto statement provides an unconditional jump from the "goto" to a labeled statement. For example, a statement "goto CHECK_NUM;" is executed, control of the program jumps to CHECK_NUM. Using these constructs, you can implement, for example, loops.

Note that use of goto statement is highly discouraged, because it is difficult to trace the control flow of a program which includes goto.

Write a program which does precisely the same thing as the following program (this example is wrtten in C++). Let's try to write the program without goto statements.

void call(int n){
  int i = 1;
 CHECK_NUM:
  int x = i;
  if ( x % 3 == 0 ){
    cout n is given in a line.

Output

Print the output result of the above program for given integer n.

Constraints

3 ≤ n ≤ 10000

Sample Input

30

Sample Output

 3 6 9 12 13 15 18 21 23 24 27 30

  Put a single space character before each element.



Sample input:
30


Sample output:
 3 6 9 12 13 15 18 21 23 24 27 30

Submission status: Wrong Answer

Solution code:
import sys


def main():
    n = int(sys.stdin.readline())
    i = 1
    while i <= n:
        x = i
        if x % 3 == 0:
            print(' {}'.format(i), end='')
        elif x % 10 == 3:
            print(' {}'.format(i), end='')
        i += 1
    print()
    return


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
l=""
for i in range(1,n+1):
    if i % 3==0 or i % 10 == 3:
        l+=" "+str(i)
print(l)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=""
for i in range(1,n+1):
    if i % 3==0 or i % 10 == 3 or (i % 100)//10 == 3 or (i % 1000)//100 == 3:
        l+=" "+str(i)
print(l)

Submission status: Wrong Answer

Solution code:
a = input()
i = 0
for i in range(int(a)):
    if ((int(i) + 1) % 3) == 0:
        print(' {}'.format(int(i)+1),end='')

Submission status: Wrong Answer

Solution code:
a = input()
i = 0
for i in range(int(a)):
    if ((int(i) + 1) % 3) == 0:
        print(' ',end='')
        if (int(i)+1) == int(a):
            print('{}'.format(int(i)+1))
        else:
            print('{}'.format(int(i)+1),end='')
    elif((int(i) + 1) % 10) == 3:
        print(' ',end='')
        if (int(i)+1) == int(a):
            print('{}'.format(int(i)+1))
        else:
            print('{}'.format(int(i)+1),end='')
        i /= 10
    elif  (int(i)+1) == int(a):
        print('')

Submission status: Wrong Answer

Solution code:

a = input()
i = 0
for i in range(int(a)):
    if ((int(i) + 1) % 3) == 0:
        print(' {}'.format(int(i)+1),end='')
    elif((int(i) + 1) % 10) == 3:
        print(' {}'.format(int(i)+1),end='')
    elif (int(i)+1) == int(a):
        print('')
    else:
        x = i // 10
        if x == 3:
            print(' {}'.format(int(i)+1),end='')
print('')

Submission status: Wrong Answer

Solution code:
a = input()
i = 0
for i in range(int(a)+1):
    if ((int(i)+1) % 3) == 0:
        print(' {}'.format(int(i)+1),end='')
    elif((int(i)+1) % 10) == 3:
        print(' {}'.format(int(i)+1),end='')
    else:
        y = int(i)+1 
        x = (int(i)+1) // 10
        if int(x) == 3:
            print(' {}'.format(int(i)+1),end='')
print('')

Submission status: Wrong Answer

Solution code:
a = input()
i = 0
for i in range(int(a)):
    if ((int(i)+1) % 3) == 0:
        print(' {}'.format(int(i)+1),end='')
    elif((int(i)+1) % 10) == 3:
        print(' {}'.format(int(i)+1),end='')
    else:
        x = (int(i)+1) // 10
        if int(x) == 3:
            print(' {}'.format(int(i)+1),end='')
print('')

Submission status: Wrong Answer

Solution code:
a = input()
i = 0
for i in range(int(a)):
    if ((int(i)+1) % 3) == 0:
        print(' {}'.format(int(i)+1),end='')
    elif((int(i)+1) % 10) == 3:
        print(' {}'.format(int(i)+1),end='')
    else:
        x = (int(i)+1) // 10
        if int(x) == 1:
            print(' {}'.format(int(i)+1),end='')
        elif (int(x) % 10) == 3:
            print(' {}'.format(int(i)+1),end='')
print('')

Submission status: Wrong Answer

Solution code:
a = input()
i = 0
for i in range(int(a)):
    if ((int(i)+1) % 3) == 0:
        print(' {}'.format(int(i)+1),end='')
    elif((int(i)+1) % 10) == 3:
        print(' {}'.format(int(i)+1),end='')
    else:
        x = (int(i)+1) // 10
        if (int(x) % 10) == 3:
            print(' {}'.format(int(i)+1),end='')
print('')

Submission status: Wrong Answer

Solution code:

a = input()
i = 0
v = 0
for i in range(int(a)):
    if ((int(i)+1) % 3) == 0:
        print(' {}'.format(int(i)+1),end='')
    elif((int(i)+1) % 10) == 3:
        print(' {}'.format(int(i)+1),end='')
    else:
        while v == 0:
            x = (int(i)+1) / 10
            if (int(x) % 10) == 3:
                print(' {}'.format(int(i)+1),end='')
                v = 1
            elif (int(x) % 10) < 10:
                v = 1
    v = 0
    
print('')

Submission status: Wrong Answer

Solution code:

n = int(input())

for i in range(1, n + 1):
	x = i

	if x % 3 == 0:
		print("", i, end = "")
		continue

	while True:
		if x % 10 == 3:
			print("", i, end = "")
			break

		x /= 10

		if x != 0:
			continue

		break
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
b = []
for i in range(1,a+1):
    if i%3 == 0:
        b.append(i)
    elif i%10 == 3:
        b.append(i)
    else:
        continue
for i in b:
    print(" "+str(i),end="")
print("\n",end="")

Submission status: Wrong Answer

Solution code:
a = int(input())
b = []
for i in range(1,a+1):
    if i%3 == 0:
        b.append(i)
    elif i%10 == 3:
        b.append(i)
    elif i//10 == 3 :
        b.append(i)
    else:
        continue
for i in b:
    print(" "+str(i),end="")
print("\n",end="")

Submission status: Wrong Answer

Solution code:
a = int(input())
b = []
for i in range(1,a+1):
    if i%3 == 0:
        b.append(i)
    elif i%10 == 3:
        b.append(i)
    elif i//10 == 3 :
        b.append(i)
    elif (i//10)%10 == 3:
        b.append(i)
    else:
        continue
for i in b:
    print(" "+str(i),end="")
print("\n",end="")

Submission status: Wrong Answer

Solution code:
a = int(input())
b = []
for i in range(1,a+1):
    if i%3 == 0:
        b.append(i)
    elif i%10 == 3:
        b.append(i)
    elif (i//10)%10 == 3:
        b.append(i)
    else:
        continue
for i in b:
    print(" "+str(i),end="")
print("\n",end="")

Submission status: Wrong Answer

Solution code:
a = int(input())
b = []
for i in range(1,a+1):
    if i%3 == 0:
        b.append(i)
    elif i%10 == 3:
        b.append(i)
    elif (i//10)%10 == 3:
        b.append(i)
    elif((i//10)//10)%10 == 3:
        b.append(i)
    else:
        continue
for i in b:
    print(" "+str(i),end="")
print("\n",end="")

Submission status: Wrong Answer

Solution code:
k = int(input())


def call(m: int) -> str:
    result = ""
    for i in range(1, m + 1):
        result += " " + str(i) if i % 3 == 0 or i % 10 == 3 else ""
    return result


print(call(k))

Submission status: Wrong Answer

Solution code:
k = int(input())


def call(m: int) -> str:
    result = ""
    for i in range(1, m + 1):
        x = i
        if x % 3 == 0:
            result += " " + str(i)
        elif x % 10 == 3:
            result += " " + str(i)
        x /= 10
        if x != 0 and x % 10 == 3:
            result += " " + str(i)

    return result


print(call(k))

Submission status: Wrong Answer

Solution code:
k = int(input())


def call(m: int) -> str:
    result = ""
    for i in range(1, m + 1):
        x = i
        if x % 3 == 0:
            result += " " + str(i)
        elif x % 10 == 3:
            result += " " + str(i)
        else:
            x /= 10
            if x != 0 and x % 10 == 3:
                result += " " + str(i)

    return result


print(call(k))

Submission status: Wrong Answer

Solution code:
n = int(input())
s = ''
for i in range(n):
    if (i+1)%3==0 or (i+1)%10==3:
        s += ' '+str(i+1)
print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())
s = ''
for i in range(n):
    if (i+1)%3==0 or (i+1)%10==3 or (i+1)//10%3==0:
        s += ' '+str(i+1)
print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())
s = ''
for i in range(n):
    if (i+1)%3==0 or (i+1)%10==3:
        s += ' '+str(i+1)
        continue
    x = (i+1)//10
    if x and x%3==0:
        s += ' '+str(i+1)
print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())
s = ''
for i in range(n):
    if (i+1)%3==0 or (i+1)%10==3:
        s += ' '+str(i+1)
        continue
    x = (i+1)//10
    if x and x%10==3:
        s += ' '+str(i+1)
print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())
s = ''
for i in range(n):
    x = i+1
    if x%3==0:
        s += ' '+str(x)
        continue
    
    while x:
        if x%10==3:
            s += ' '+str(x)
            break
        x = x//10
print(s)

Submission status: Wrong Answer

Solution code:
from sys import stdout
n = int(input())

for i in range(n + 1):
    x = i
    if x % 3 == 0:
        stdout.write(" " + str(i))
    else:
        while x != 0:
            if x % 10 == 3:
                stdout.write(" " + str(i))
            x //= 10
print()

Submission status: Wrong Answer

Solution code:
from sys import stdout
n = int(input())

for i in range(1, n + 1):
    x = i
    if x % 3 == 0:
        stdout.write(" " + str(i))
    else:
        while x != 0:
            if x % 10 == 3:
                stdout.write(" " + str(i))
            x //= 10
print()

Submission status: Wrong Answer

Solution code:
from sys import stdout
n = int(input())

for i in range(1, n + 1):
    x = i
    if x % 3 == 0:
        stdout.write(" " + str(i))
    else:
        while x:
            if x % 10 == 3:
                stdout.write(" " + str(i))
            x /= 10
print()

Submission status: Wrong Answer

Solution code:
from sys import stdout
n = int(input())

for i in range(1, n + 1):
    x = i
    if x % 3 == 0:
        stdout.write(" " + str(i))
    else:
        while x:
            if x % 10 == 3:
                stdout.write(" " + str(i))
            x //= 10
print()

Submission status: Wrong Answer

Solution code:
from sys import stdout
n = int(input())
i = 1

while True:
    x = i
    if x % 3 == 0:
        stdout.write(" " + str(i))
    else:
        while x:
            if x % 10 == 3:
                stdout.write(" " + str(i))
                i += 1
                if i > n: break
            x //= 10
    i += 1
    if i > n: break
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n + 1):
	if i % 3 == 0 or str(i).find("3") != -1:
		print(" {}".format(i), end = '')
print()

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
for i in range(x+1):
    if i%3==0:
        print(f" {i}",end="")
        continue
    r=i
    while True:
        if r<=0:
            break
        if r%10==3:
            print(f" {i}",end="")
            break
        r//=10
print("")

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1, a+1):
    if(a % 3 == 0 or a % 10 == 3):
        print(" %d"%(a))

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1, a+1):
    if(a % 3 == 0 or a % 10 == 3):
        print(" %d"%i)

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1, a+1):
    if(i % 3 == 0 or i % 10 == 3):
        print(" %d"%i, end = "")
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1, a+1):
    if(i % 3 == 0 or i % 10 == 3 or i // 10 == 3):
        print(" %d"%i, end = "")
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1, a+1):
    while True:
        if(i < 100):
            break
    if(i % 3 == 0 or i % 10 == 3):
        print(" %d"%i, end = "")
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1, a+1):
    x = i
    if(x < 100):
        x //= 10
    if(x % 3 == 0 or x % 10 == 3 or x // 10 == 3):
        print(" %d"%x, end = "")
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1, a+1):
    x = i
    if(x > 100):
        x //= 10
    if(x % 3 == 0 or x % 10 == 3 or x // 10 == 3):
        print(" %d"%x, end = "")
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1, a+1):
    x = i
    if(x % 3 == 0 or x % 10 == 3 or x // 10 == 3):
        print(" %d"%x, end = "")
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1, a+1):
    x = i
    if(x % 3 == 0 or x % 10 == 3):
        print(" %d"%x, end = "")
    elif(x > 100):
        while True:
            x //= 10
            if(x < 100):
                break
        
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1, a+1):
    x = i
    if(x % 3 == 0 or x % 10 == 3 or x // 10 == 3):
        print(" %d"%x, end = "")
    elif(x > 100):
        while True:
            x //= 10
            if(x < 100):
                break
        
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1, a+1):
    x = i
    if(x % 3 == 0 or x % 10 == 3):
        print(" %d"%x, end = "")
    else:
        x //= 10
        if(x % 10 == 3):
            print(" %d"%x, end = "")
        
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1, a+1):
    x = i
    if(x % 3 == 0 or x % 10 == 3):
        print(" %d"%x, end = "")
    else:
        x //= 10
        if(x % 3 == 0 or x % 10 == 3):
            print(" %d"%x, end = "")
        
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1, a+1):
    x = i
    if(x % 3 == 0):
        print(" %d"%x, end = "")
    else:
        while True:
            if(x % 10 == 3):
                print(" %d"%x, end = "")
            x //= 10
            if(x < 1):
                break
        
        
print()

Submission status: Wrong Answer

Solution code:

Submission status: Wrong Answer

Solution code:
n = int(input())
x = 1
y = ""
z = 1
while True:
    z = 1
    x += 1
    if x % 3 == 0:
        y += " "
        y += str(x)
    else:
        while True:
            b = int(x % 10 ** (z - 1))
            a = int((x - b) / 10 ** z)
            c = a % 10 ** z
            d = a % 10 ** (z - 1)
            if a == 3 or b == 3 or c == 3 or d == 3:
                y += " "
                y += str(x)
                break
            z += 1
            if a < 3:
                break
    if x >= n:
        break
print(y)

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
for i in range(3, n + 1, 3):
    sys.stdout.write("%d " % (i))

Submission status: Wrong Answer

Solution code:
out = ""
for i in range(1, int(input()) + 1):
    if i % 3 == 0 or i % 10 == 3:
        out += " " + str(i)
print(out)

Submission status: Wrong Answer

Solution code:
out = ""
for i in range(1, int(input()) + 1):
    if i % 3 == 0 or i % 10 == 3 or i // 10:
        out += " " + str(i)
print(out)

Submission status: Wrong Answer

Solution code:
out = ""
for i in range(1, int(input()) + 1):
    if i % 3 == 0 or i % 10 == 3 or i // 10 == 3:
        out += " " + str(i)
print(out)

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(1, n+1):
    if i % 3 == 0:
        print(' %d' % i, end='')
    elif i % 10 == 3:
        print(' %d' % i, end='')

print()

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(1, n+1):
    if i % 3 == 0 or i % 10 == 3 or i // 10 % 10 == 3:
        print(' %d' % i, end='')
print()

Submission status: Wrong Answer

Solution code:
num = int(input())
for i in range(1, num + 1):
    if i % 3 == 0:
        print(f' {i}', end='')
        continue
    if i % 10 == 3:
        print(f' {i}', end='')
print()

Submission status: Wrong Answer

Solution code:
num = int(input())
for i in range(1, num + 1):
    if i % 3 == 0:
        print(f' {i}', end='')
        continue
    x = i
    while True:
        if x % 10 == 3:
            print(f' {i}', end='')
        x = int(x / 10)
        if x < 1:
            break
print()

Submission status: Wrong Answer

Solution code:
num = int(input())
for i in range(1, num + 1):
    if i % 3 == 0:
        print(f' {i}', end='')
    else:
        x = i
        while x:
            if x % 10 == 3:
                print(f' {i}', end='')
                break
            x /= 10
print()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

n=int(input())
for i in range(n):
    if (i+1)%3==0:
        print(i+1)

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(n):
    if (i+1)%3==0:
        print(" "+str(i+1),end="")
    elif (i+1)%10==3:
        print(" "+str(i+1),end="")
print()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

n=int(input())
for i in range(n):
    if (i+1)%3==0:
        print(" "+str(i+1),end="")
    elif (i+1)%10==3:
        print(" "+str(i+1),end="")
    elif (i+1)//10==3:
        print(" "+str(i+1),end="")
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
a =[]
for i in range(1, n+1):
    if i % 3 == 0 or i % 10 == 3 or (i//100)%10 == 3 or (i//1000)%10 == 3 or (i//10000)%10 == 3:
        a.append(i)
print(' ', end ='')
print(*a)

Submission status: Wrong Answer

Solution code:
inData = int(input())

seqData = list(range(1,inData+1,1))
outData = [0] * inData
for thisData in seqData:
    if thisData == inData:
        print(thisData)
    else:
        if thisData%3 == 0:
            print(thisData, end = "")
        else:
            pass

Submission status: Wrong Answer

Solution code:
inData = int(input())

seqData = list(range(1,inData+1,1))
outData = [0] * inData
for thisData in seqData:
    if thisData == inData:
        print(" "+str(thisData))
    else:
        if thisData%3 == 0:
            print(" "+str(thisData), end = "")
        else:
            pass

Submission status: Wrong Answer

Solution code:
inData = int(input())

seqData = list(range(1,inData+1,1))
outData = [0] * inData
for thisData in seqData:
    if thisData == inData:
        print(" "+str(thisData))
    else:
        if thisData%3 == 0 or thisData%10==3:
            print(" "+str(thisData), end = "")
        else:
            pass

Submission status: Wrong Answer

Solution code:
inData = int(input())

seqData = list(range(1,inData+1,1))
outData = [0] * inData
for thisData in seqData:
    if thisData == inData:
        print(" "+str(thisData))
    else:
        if thisData%3 == 0 or thisData%10==3 or thisData/30>0 :
            print(" "+str(thisData), end = "")
        else:
            pass

Submission status: Wrong Answer

Solution code:
inData = int(input())

seqData = list(range(1,inData+1,1))
outData = [0] * inData
for thisData in seqData:
    if thisData == inData:
        print(" "+str(thisData))
    else:
        if thisData%3 == 0 or thisData%10==3 or int(thisData/30)>=1 :
            print(" "+str(thisData), end = "")
        else:
            pass

Submission status: Wrong Answer

Solution code:
inData = int(input())

seqData = list(range(1,inData+1,1))
outData = [0] * inData
for thisData in seqData:
    if thisData == inData:
        print(" "+str(thisData))
    else:
        if thisData%3 == 0 or thisData%10==3 or thisData%30<10 :
            print(" "+str(thisData), end = "")
        else:
            pass

Submission status: Wrong Answer

Solution code:
inData = int(input())

seqData = list(range(1,inData+1,1))
outData = [0] * inData
for thisData in seqData:
    if thisData == inData:
        print(" "+str(thisData))
    else:
        if thisData%3 == 0 or thisData%10==3 or (thisData%30<10 and thisData/30>=1) :
            print(" "+str(thisData), end = "")
        else:
            pass

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
for i in range(1, n + 1):
    if i % 3 == 0 or i % 10 == 3:
        a.append(str(i))
print(" " + " ".join(a))

Submission status: Wrong Answer

Solution code:
inData = int(input())

seqData = list(range(1,inData+1,1))
outData = [0] * inData
for thisData in seqData:
    if thisData == inData:
        print(" "+str(thisData))
    else:
        if thisData%3 == 0 or thisData%10==3 or (thisData/10)%10==3>=1 :
            print(" "+str(thisData), end = "")
        else:
            pass

Submission status: Wrong Answer

Solution code:
inData = int(input())

seqData = list(range(1,inData+1,1))
outData = [0] * inData
for thisData in seqData:
    if thisData == inData:
        print(" "+str(thisData))
    else:
        if thisData%3 == 0 or thisData%10==3 or int((thisData/10))%10==3>=1 :
            print(" "+str(thisData), end = "")
        else:
            pass

Submission status: Wrong Answer

Solution code:
inData = int(input())

seqData = list(range(1,inData+1,1))
outData = [0] * inData
for thisData in seqData:
    if thisData == inData:
        if thisData%3 == 0 or thisData%10==3 or int((thisData/10))%10==3>=1 :
            print(" "+str(thisData))
        else:
            print("")
    else:
        if thisData%3 == 0 or thisData%10==3 or int((thisData/10))%10==3>=1 :
            print(" "+str(thisData), end = "")
        else:
            pass

Submission status: Wrong Answer

Solution code:
inData = int(input())

seqData = list(range(1,inData+1,1))
outData = [0] * inData
for thisData in seqData:
    if thisData == inData:
        if thisData%3 == 0 or thisData%10==3 or int((thisData/10))%10==3:
            print(" "+str(thisData))
        else:
            print("")
    else:
        if thisData%3 == 0 or thisData%10==3 or int((thisData/10))%10==3:
            print(" "+str(thisData), end = "")
        else:
            pass

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(2, n + 1):
  if i % 3 == 0 or i % 10 == 3:
    print('', i, end = '')
print()

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(2, n + 1):
  if i % 3 == 0 or i % 10 == 3 or i // 10 == 3:
    print('', i, end = '')
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = 1
for i in range(1,n):
    if i % 10 == 3:
        print('{0}'.format(i))
    elif i % 3 == 0:
        if i % 10 == 3:
            continue
        print('{0}'.format(i))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = 1
for i in range(1,n):
    if i % 10 == 3:
        print('{0}'.format(i))
    elif i % 3 == 0:
        if i % 10 == 3:
            continue
        print('{0}'.format(i))
    i = i + 1

Submission status: Wrong Answer

Solution code:
n = int(input())
a = 1
for i in range(1,n):
    if i % 10 == 3:
        print('{0}'.format(i))
    elif i % 3 == 0:
        if i % 10 == 3:
            continue
        print('{0}'.format(i))
    else:
        i = i+1

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1,n):
    if i % 10 == 3:
        print('{0}'.format(i))
    elif i % 3 == 0:
        if i % 10 == 3:
            continue
        print('{0}'.format(i))

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1,n):
    if i % 10 == 3:
        print('{0}'.format(i))
    elif i % 3 == 0:
        if i % 10 == 3:
            continue
    print('{0}'.format(i))

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1,n):
    if i % 10 == 3:
        print('{0}'.format(i))
        if i % 3 == 0:
            continue
    elif i % 3 == 0:
        print('{0}'.format(i))

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1,n):
    if i % 10 == 3:
        print('{0}'.format(i))
        if i % 3 == 0:
            continue
    elif i % 3 == 0:
        print('{0}'.format(i))
    i = i + 1

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1,n+1):
    if i % 10 == 3:
        print('{0}'.format(i))
        if i % 3 == 0:
            continue
    elif i % 3 == 0:
        print('{0}'.format(i))

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1,n+1):
    if i % 10 == 3:
        print('{0}'.format(i), end = " ")
        if i % 3 == 0:
            continue
    elif i % 3 == 0:
        print('{0}'.format(i), end = " ")
    print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1,n+1):
    if i % 3 == 0 or str(i).find("3"):
        print(" " + str(i),end = "")
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(3, n+1, 3):
    print(' '+str(i), end='')

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n+1):
    if i%3 == 0:print(' '+str(i), end='')
    elif i%10 == 3:print(' '+str(i), end='')

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, n+1):
    if i%3 == 0:print(' '+str(i), end='')
    elif i%10 == 3:print(' '+str(i), end='')
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, n+1):
    if i%3 == 0:print(' '+str(i))
    elif i%10 == 3:print(' '+str(i))

Submission status: Wrong Answer

Solution code:
n = int(input())

result = ""
for i in (range(1,n+1)):
    if i % 3 == 0:
        result += " " + str(i)
        continue
    if i % 10 == 3:
        result += " " + str(i)
       
print (result)

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(1, n + 1):
	if i%3==0 or str(i).find('3') == 1: print(" {}".format(i), end='')
print()

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(1, n + 1):
	if i%3==0 or str(i).find('3') == True: print(" {}".format(i), end='')
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, n) :
	x = i
	if(x % 3 == 0 or x % 10 == 3) :
		print(" ", i, end = "")
		i += 1
	else :
		i += 1
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, n + 1) :
	x = i
	if(x % 3 == 0 or x % 10 == 3) :
		print("", i, end = "")
		i += 1
	else :
		i += 1
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, n + 1) :
	x = i
	if(x % 3 == 0 or x % 10 == 3) :
		print("", i, sep = "")
		i += 1
	else :
		i += 1
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, n + 1) :
	x = i
	if(x % 3 == 0 or x % 10 == 3) :
		print(" ", i, sep = "")
		i += 1
	else :
		i += 1
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, n + 1) :
	x = i
	if(x % 3 == 0 or x % 10 == 3) :
		print(" ", i, sep = "", end = "")
		i += 1
	else :
		i += 1
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, n + 1) :
	x = i
	if(x % 3 == 0) :
		print(" ", i, sep = "", end = "")
		i += 1
	elif(x % 10 == 3) :
		print(" ", i, sep = "", end = "")
		x /= 10
	else :
		i += 1
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, n + 1) :
	x = i
	if(x % 3 == 0 or x % 10 == 3) :
		print(" ", i, sep = "", end = "")
		i += 1
	else :
		x /= 10
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(3, n + 1) :
	x = i
	if(x % 3 == 0 or x % 10 == 3) :
		print(" ", i, sep = "", end = "")
		i += 1
	else :
		pass
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(3, n + 1) :
	if(i % 3 == 0 or i % 10 == 3) :
		print(" ", i, sep = "", end = "")
		i += 1
	else :
		pass
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(3, n + 1) :
	if(i % 3 == 0 or i % 10 == 3) :
		print(" ", i, sep = "", end = "")
		i += 1
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1,a+3):
    if i % 3 == 0:
        print(" {}".format(i), end = "")
    elif i % 10 == 3:
        print(" {}".format(i), end = "")
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1,a+3):
    if i % 3 == 0 or i % 10 == 3 or int(i/10) == 3:
        print(" {}".format(i), end = "")
    elif i % 10 == 3:
        print(" {}".format(i), end = "")
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1,a+1):
    if i % 3 == 0 or i % 10 == 3 or int(i/10) == 3:
        print(" {}".format(i), end = "")
    elif i % 10 == 3:
        print(" {}".format(i), end = "")
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1,a+1):
    if i % 3 == 0 or (int(i/10) % 3 == 0 and int(i/10) != 0):
        print(" {}".format(i), end = "")
    elif i % 10 == 3:
        print(" {}".format(i), end = "")
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1,a+1):
    if i % 3 == 0 or (int(i/10) % 10 == 3 and int(i/10) != 0):
        print(" {}".format(i), end = "")
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1,a+1):
    if i % 3 == 0 or i % 10 == 3 or (int(i/10) % 10 == 3 and int(i/10) != 0):
        print(" {}".format(i), end = "")
print()

Submission status: Wrong Answer

Solution code:
a = int(input())
for i in range(1,a+1):
    x = i
    if i % 3 == 0 or i % 10 == 3:
        print(" {}".format(i), end = "")
    else:
        while int(x) > 0:
            x /= 10
            if int(x) % 10 == 3:
                print(" {}".format(i), end = "")
print()

Submission status: Wrong Answer

Solution code:
a = 500
for i in range(1,a+1):
    x = i
    if i % 3 == 0 or i % 10 == 3:
        print(" {}".format(i), end = "")
    else:
        while int(x) > 0:
            x /= 10
            if int(x) % 10 == 3:
                print(" {}".format(i), end = "")
                break
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1

while True:
    x = i
    if  x % 3 == 0 or x % 10 ==3 or x / 10 == 0:
        print(" %d" ,i)
    i+=1
    if i > n:
        print()
        break

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret += " " + str(i)
    i+=1
    if i > n:
        break

    print(ret)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret += " " + str(i)
    elif x % 10 == 3:
        ret += " " + str(i)
    i+=1
    if i > n:
        break

    print(ret)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret += " " + str(i)
    elif x % 10 == 3:
        ret += " " + str(i)
    elif x // 10 == 3:
        ret += " " + str(i)
    i+=1
    if i > n:
        break

    print(ret)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret += " " + str(i)
    elif x % 10 == 3:
        ret += " " + str(i)
    elif x // 10 == 3:
        ret += " " + str(i)
    i+=1
    if i > n:
        break

print(ret)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret += " " + str(i)
    elif x % 10 == 3:
        ret += " " + str(i)
    i+=1
    if i > n:
        break

print(ret)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret += " " + str(i)
    elif x % 10 == 3:
        ret += " " + str(i)
    else:
        x //= 10
        while x > 0:
            if x % 10 == 3:
                ret += " " + str(i)
            x //= 10
    i+=1
    if i > n:
        break

print(ret)