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: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
a = int(input())

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
a=int(input())

for i in range(3,a+1):
    if i% 3==0:
        print(" "+str(i),end=" ")

    else:
        s=str(i)
        if "3" in s:
            print(" "+str(i),end=" ")

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
# (c) midandfeed
n = int(input())
	
for i in range(1, n+1):
	if (i%3==0) or (i%10==3):
		print(i, end='')
		if (i!=n):
			print(' ', end='')
print()

Submission status: WA: Presentation Error

Solution code:
num = int(input())

for i in range(1,num + 1):
    x = str(i)
    if i % 3 == 0:
        print (i, end = ' ')
    elif '3' in x:
        print (i, end = ' ')

print()

Submission status: WA: Presentation Error

Solution code:
n = int(input())
result = []
def check(x, y, remnant):
    return x % y == remnant

for i in range(1, n + 1):
    x = i
    if check(x, 3, 0):
        result.append(i)
        continue
    for j in range(len(str(x)) - 1):
        if check(x, 10, 3):
            result.append(i)
            break
        x //= 10
print(' '.join(map(str, result)))

Submission status: WA: Presentation Error

Solution code:
import sys

#n = int(raw_input())
n = 30

for i in range(1, n+1):
	if i % 3 == 0:
		sys.stdout.write(" {:}".format(i))
	elif str(i).find('3') > -1:
		sys.stdout.write(" {:}".format(i))

Submission status: WA: Presentation Error

Solution code:
import sys

n = int(raw_input())

for i in range(1, n+1):
	if i % 3 == 0:
		sys.stdout.write(" {:}".format(i))
	elif str(i).find('3') > -1:
		sys.stdout.write(" {:}".format(i))

Submission status: WA: Presentation Error

Solution code:
import sys

n = int(raw_input())
#n = 30


for i in range(1, n+1):
	if i % 3 == 0:
		sys.stdout.write(" {:}".format(i))
	elif str(i).find('3') > -1:
		sys.stdout.write(" {:}".format(i))

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
n=input()
s=''
for i in range(1,int(n)+1):
    s += (str(i) + ' ') if i%3==0 or '3' in str(i) else ''
print(s[0:len(s)-1])

Submission status: WA: Presentation Error

Solution code:
def main():
    n = int(input())
    _list = list(range(1,n+1))
    for x in _list:
        if x % 3 == 0 or x % 10 == 3:
            print(' %d' %  x, end = '')
    

main()

Submission status: WA: Presentation Error

Solution code:
x = int(input())
i = 1
while i <= x:
    
    if (i % 3) == 0:
        if (i + 3) <= x:
            print(i, end=" ")
        elif (x % 10) == 3:
            print(i, end=" ")
        else:
            print(i)
      
        
    elif (i % 10) == 3:
        if i != x:
            print(i, end=" ")
        else:
            print(i)
    
    i += 1

Submission status: WA: Presentation Error

Solution code:
x = int(input())
i = 1
print(" ", end="")
while i <= x:
    
    if (i % 3) == 0:
        if (i + 3) <= x:
            print(i, end=" ")
        elif (x % 10) == 3:
            print(i, end=" ")
        else:
            print(i)
      
        
    elif (i % 10) == 3:
        if i != x:
            print(i, end=" ")
        else:
            print(i)
    
    i += 1

Submission status: WA: Presentation Error

Solution code:
import sys

def main():
    lines = sys.stdin.readlines()
    input_num = 0
    for line in lines:
        # print(line)
        # rm '\n' from string of a line
        line = line.strip('\n')
        input_num = int(line)
        # print input_num
        index_num = 1
        while True:
            x = index_num
            if x % 3 == 0:
                sys.stdout.write(" " + str(x))
                if (index_num + 1) > input_num:
                    break
                index_num += 1
                # print index_num
                continue
            while True:
                if x % 10 == 3:
                    sys.stdout.write(" " + str(x))
                if x / 10 == 0:
                    break
                else:
                    x /= 10
            if (index_num + 1) > input_num:
                break
            else:
                index_num += 1
                # print index_num

        break


if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

Solution code:
import sys

def main():
    lines = sys.stdin.readlines()
    input_num = 0
    ans = []
    for line in lines:
        # print(line)
        # rm '\n' from string of a line
        line = line.strip('\n')
        input_num = int(line)
        n = input_num
        # print input_num
        index_num = 1
        flag = 0
        while True:
            # END CHECKNUM
            if index_num != 1 or flag == 1:
                if (index_num + 1) > n:
                    break
                else:
                    index_num += 1 # Go on below
            else:
                flag = 1
            x = index_num
            if x % 3 == 0:
                print index_num,
                continue
            if x % 10 == 3:
                print index_num,
                continue
            else:
                while x > 0:
                    x /= 10
                    if x % 10 == 3:
                        print index_num,
                        break

        break


if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

Solution code:
import sys

def main():
    lines = sys.stdin.readlines()
    input_num = 0
    ans = []
    for line in lines:
        # print(line)
        # rm '\n' from string of a line
        line = line.strip('\n')
        input_num = int(line)
        n = input_num
        # print input_num
        print " "
        index_num = 1
        flag = 0
        while True:
            # END CHECKNUM
            if index_num != 1 or flag == 1:
                if (index_num + 1) > n:
                    break
                else:
                    index_num += 1 # Go on below
            else:
                flag = 1
            x = index_num
            if x % 3 == 0:
                print index_num,
                continue
            if x % 10 == 3:
                print index_num,
                continue
            else:
                while x > 0:
                    x /= 10
                    if x % 10 == 3:
                        print index_num,
                        break

        break


if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

Solution code:
import sys

def main():
    lines = sys.stdin.readlines()
    input_num = 0
    ans = []
    for line in lines:
        # print(line)
        # rm '\n' from string of a line
        line = line.strip('\n')
        input_num = int(line)
        n = input_num
        # print input_num
        print " ",
        index_num = 1
        flag = 0
        while True:
            # END CHECKNUM
            if index_num != 1 or flag == 1:
                if (index_num + 1) > n:
                    break
                else:
                    index_num += 1 # Go on below
            else:
                flag = 1
            x = index_num
            if x % 3 == 0:
                print index_num,
                continue
            if x % 10 == 3:
                print index_num,
                continue
            else:
                while x > 0:
                    x /= 10
                    if x % 10 == 3:
                        print index_num,
                        break

        break


if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

Solution code:
print(*[x for x in range(3,int(input())+1) if x % 3 == 0 or '3' in str(x)])

Submission status: WA: Presentation Error

Solution code:
def threeDivCheck(x):
  if x % 3 == 0: return x
  return 0

def threeIncludeCheck(x):
  y = x
  while y!=0:
    if y%10 == 3:
      return x
    y/=10
  return 0

def main():
  n = int(input())
  p = 0
  for i in range(n+1):
    p = threeDivCheck(i)
    if p:
      print(' {}'.format(p), end='')
    else:
      p=threeIncludeCheck(i)
      if p:
        print(' {}'.format(p), end='')

main()

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
n=int(input())
m=[]
for i in range(1,n+1):
 a=i
 if a%3==0:
  m.append(i)
  continue
 while a>0:
  if a%10==3:
   m.append(i)
   break
  a/=10
print(*m)

Submission status: WA: Presentation Error

Solution code:
n=int(input())
m=[' ']
for i in range(1,n+1):
 a=i
 if a%3==0:
  m.append(i)
  continue
 while a>0:
  if a%10==3:
   m.append(i)
   break
  a/=10
print(*m[1:])

Submission status: WA: Presentation Error

Solution code:
n=int(input())
m=[' ']
for i in range(1,n+1):
 a=i
 if a%3==0:
  m.append(i)
  continue
 while a>0:
  if a%10==3:
   m.append(i)
   break
  a/=10
print(*m)

Submission status: WA: Presentation Error

Solution code:
n=int(input())
a=[]
for i in range(3,n+1):
 if i%3==0:a.append(i)
 elif '3' in list(str(i)):a.append(i)
print(*a)

Submission status: WA: Presentation Error

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

print(*list)

Submission status: WA: Presentation Error

Solution code:

def check(st):
    for d in range(len(st)):
        if st[d]=="3":
            return True
    return False

num = int(input())
str=""
for d in range(3,num+1):
    s = "%d"%(d)
    if d%3==0 or check(s):
        str+="%d "%(d)
print(str[:-1])

Submission status: WA: Presentation Error

Solution code:
n = int(input())

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

Submission status: WA: Presentation Error

Solution code:
n = int(input())

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

Submission status: WA: Presentation Error

Solution code:
n = int(input())

result = [" "]
for i in range(3, n + 1):
    if i % 3 == 0:
        result.append(i)
    elif "3" in list((str(i))):
        result.append(i)
print(*result)

Submission status: WA: Presentation Error

Solution code:
def main():
    n = int(input())

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

if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

Solution code:
def nabeatsu(a):
    if (a%3 == 0):
        return True

    while a != 0:
        if a % 10 == 3:
            return True

        a //= 10

    return False

def main():
    n = int(input())
    for i in range(1,n+1):
        if nabeatsu(i):
            print("{0} ".format(i),end="")

if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

Solution code:
def nabeatsu(a):
    if (a%3 == 0):
        return True

    while a != 0:
        if a % 10 == 3:
            return True

        a //= 10

    return False

def main():
    n = int(input())
    for i in range(1,n+1):
        if nabeatsu(i):
            print(" {0}".format(i),end="")

if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

Solution code:
def nabeatsu(a):
    if a % 3 == 0:
        return True

    while a != 0:
        if a % 10 == 3:
            return True
        
        a //= 10

    return False

def main():
    n = int(input())
    for i in range(1,n+1):
        if nabeatsu(i):
            print(" {0}".format(i),end="")

if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

Solution code:
def nabeatsu(a):
    if a % 3 == 0:
        return True

    while a != 0:
        if a % 10 == 3:
            return True

        a //= 10

    return False

def main():
    n = int(input())

    for i in range(1,n+1):
        if nabeatsu(i):
            print(" {0}".format(i),end="")

if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

Solution code:
def nabeatsu(a):
    if a % 3 == 0:
        return True

    while a != 0:
        if a % 10 == 3:
            return True

        a //= 10

    return False

def main():
    n = int(input())

    for i in range(1,n+1):
        if nabeatsu(i):
            print("",i,end="")

if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

Solution code:
def nabeatsu(a):
    if a % 3 == 0:
        return True

    while a != 0:
        if a % 10 == 3:
            return True

        a //= 10

    return False

def main():
    n = int(input())

    for i in range(1,n+1):
        if nabeatsu(i):
            print("{0} ".format(i),end="")

if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

Solution code:
def nabeatsu(a):
    if a % 3 == 0:
        return True

    while a != 0:
        if a % 10 == 3:
            return True

        a //= 10

    return False

def main():
    n = int(input())

    for i in range(1,n+1):
        if nabeatsu(i):
            print("{0}".format(i),end="")

if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

Solution code:
def nabeatsu(a):
    if a % 3 == 0:
        return True

    while a != 0:
        if a % 10 == 3:
            return True

        a //= 10

    return False

def main():
    n = int(input())

    for i in range(1,n+1):
        if nabeatsu(i):
            print("  {0}".format(i),end="")

if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

Solution code:
def call(a):
    if a % 3 == 0:
        return True

    while a != 0:
        if a % 10 == 3:
            return True

        a //= 10

    return False


def main():
    n = int(input())

    for i in range(1, n + 1):
        if call(i):
            print(" {0}".format(i), end="")


if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

Solution code:
def call(a):
    if a % 3 == 0:
        return True

    while a != 0:
        if a % 10 == 3:
            return True

        a = int(a / 10)

    return False

def main():
    n = int(input())

    for i in range(1, n + 1):
        if call(i):
            print(" {0}".format(i), end="")

if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

Solution code:
def call(a):
    if a % 3 == 0:
        return True

    while a != 0:
        if a % 10 == 3:
            return True

        a //= 10

    return False

def main():
    n = int(input())

    for i in range(1, n + 1):
        if call(i):
            print(" {0}".format(i), end="")

if __name__ == "__main__":
    main()

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
n = int(input())

i = 1
while i <= n:
    if i % 3 ==0:
        print(" {:d}".format(i),end="")
    elif i % 10 == 3:
        print(" {:d}".format(i),end="")
    i += 1

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
for i in range(1,int(raw_input())+1):
    b = i
    if(b % 3 == 0 or b % 10 == 3):
        print i,
        continue
    b /= 10
    if(b % 10 == 3):
        print i,

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
num = int(input())
result=""
for i in range(1,num+1):
    if i%3==0:
        result+=str(i)+" "
    elif str(i).find("3")!=-1:
        result+=str(i)+" "
print(result)

Submission status: WA: Presentation Error

Solution code:
num = int(input())
result=" "
for i in range(1,num+1):
    if i%3==0:
        result+=str(i)+" "
    elif str(i).find("3")!=-1:
        result+=str(i)+" "
print(result)

Submission status: WA: Presentation Error

Solution code:

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

Submission status: WA: Presentation Error

Solution code:

for i in range(30):
    if (i+1) % 3 == 0 or "3" in str(i+1) :
        print(str(i+1) + " ", end="")
print()

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
n = int(input())
for i in range(1, n+1) :
    x = i
    if (x%3 == 0) :
        print(' ' + str(i), end = '')
    else :
        while True :
            if (x%10 == 3) :
                print(' ' + str(i), end = '')
                break
            x /= 10
            if (x == 0) :
                break
print('\n')

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
def Check_Num(n):

    for i in range(1,n + 1):
        x = i
        if (x % 3 == 0):
            print(' {}'.format(i),end = '')
            continue
        elif (x % 10 == 3):
            print(' {}'.format(i),end = '')
            continue
        x //= 10
        while (x > 0):
            if (x % 10 == 3):
                print(' {}'.format(i),end = '')
            x //= 10

if __name__ == '__main__':
    n = int(input())
    Check_Num(n)

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

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

Submission status: WA: Presentation Error

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

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

Submission status: WA: Presentation Error

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

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

print("\n")

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
n = int(input())
list = [x for x in range(3, n+1) if x % 3 == 0 or '3' in str(x)]
print(' '.join(map(str, list)))

Submission status: WA: Presentation Error

Solution code:
n = int(input())
list = [x for x in range(3, n+1) if x % 3 == 0 or '3' in str(x)]
print(' '.join(map(str, list)), end='')

Submission status: WA: Presentation Error

Solution code:
n = int(input())
list = [x for x in range(3, n+1) if x % 3 == 0 or '3' in str(x)]
print(' ', end='')
print(' '.join(map(str, list)), end='')

Submission status: WA: Presentation Error

Solution code:
def call(n):
    #print("call")
    i = 1
    check_num(n,i)
    return

def check_num(n,i):
    #print("check")
    x = i
    if x % 3 == 0:
        print(" ",int(i),end='')
        end_check_num(n,i)
        return
    include3(n,i,x)
    return

def include3(n,i,x):
    #print("include")
    if x % 10 == 3:
        print(" ",int(i),end='')
        end_check_num(n,i)
        return
    y = x / 10
    if y > 10:
        include3(n,i,y)
        return
    end_check_num(n,i)
    return

def end_check_num(n,i):
    #print("end")
    j = i + 1
    if j <= n:
        check_num(n,j)
        return
    print()

x = call(int(input()))

Submission status: WA: Presentation Error

Solution code:
def call(n):
    #print("call")
    i = 1
    check_num(n,i)
    return

def check_num(n,i):
    #print("check")
    x = i
    if x % 3 == 0:
        print(int(i)," ",end='')
        end_check_num(n,i)
        return
    include3(n,i,x)
    return

def include3(n,i,x):
    #print("include")
    if x % 10 == 3:
        print(int(i)," ",end='')
        end_check_num(n,i)
        return
    y = x / 10
    if y > 10:
        include3(n,i,y)
        return
    end_check_num(n,i)
    return

def end_check_num(n,i):
    #print("end")
    j = i + 1
    if j <= n:
        check_num(n,j)
        return
    print()

x = call(int(input()))

Submission status: WA: Presentation Error

Solution code:
def call(n):
    #print("call")
    i = 1
    check_num(n,i)
    return

def check_num(n,i):
    #print("check")
    x = i
    if x % 3 == 0:
        print(" ",int(i),end='')
        end_check_num(n,i)
        return
    include3(n,i,x)
    return

def include3(n,i,x):
    #print("include")
    if x % 10 == 3:
        print(" ",int(i),end='')
        end_check_num(n,i)
        return
    y = x / 10
    if y > 10:
        include3(n,i,y)
        return
    end_check_num(n,i)
    return

def end_check_num(n,i):
    #print("end")
    j = i + 1
    if j <= n:
        check_num(n,j)
        return

x = call(int(input()))

Submission status: WA: Presentation Error

Solution code:
def call(n):
    #print("call")
    i = 1
    check_num(n,i)
    return

def check_num(n,i):
    #print("check")
    x = i
    if x % 3 == 0:
        print("",int(i),end='')
        end_check_num(n,i)
        return
    include3(n,i,x)
    return

def include3(n,i,x):
    #print("include")
    if x % 10 == 3:
        print("",int(i),end='')
        end_check_num(n,i)
        return
    y = x / 10
    if y > 10:
        include3(n,i,y)
        return
    end_check_num(n,i)
    return

def end_check_num(n,i):
    #print("end")
    j = i + 1
    if j <= n:
        check_num(n,j)
        return

x = call(int(input()))

Submission status: WA: Presentation Error

Solution code:
def call(n):
    #print("call")
    i = 1
    check_num(n,i)
    return

def check_num(n,i):
    #print("check")
    x = i
    if x % 3 == 0:
        print("  ",int(i),end='')
        end_check_num(n,i)
        return
    include3(n,i,x)
    return

def include3(n,i,x):
    #print("include")
    if x % 10 == 3:
        print("  ",int(i),end='')
        end_check_num(n,i)
        return
    y = x / 10
    if y > 10:
        include3(n,i,y)
        return
    end_check_num(n,i)
    return

def end_check_num(n,i):
    #print("end")
    j = i + 1
    if j <= n:
        check_num(n,j)
        return

x = call(int(input()))

Submission status: WA: Presentation Error

Solution code:
def call(n):
    i = 1
    check_num(n,i)
    return

def check_num(n,i):
    x = i
    if x % 3 == 0:
        print(" ",int(i),end='')
        end_check_num(n,i)
        return
    include3(n,i,x)
    return

def include3(n,i,x):
    if x % 10 == 3:
        print(" ",int(i),end='')
        end_check_num(n,i)
        return
    y = x / 10
    if y > 10:
        include3(n,i,y)
        return
    end_check_num(n,i)
    return

def end_check_num(n,i):
    j = i + 1
    if j <= n:
        check_num(n,j)
        return

x = call(int(input()))

Submission status: WA: Presentation Error

Solution code:
n = int(input())
num_list = [i for i in range(1,n+1)]
num2_list = [i for i in num_list if i%3==0]
in3 = [i for i in num_list if i%10==3]
list_uniq = list(set(num2_list+in3))
list_uniq.sort()
print(' '.join(str(i) for i in list_uniq))