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:
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:
            print(" "+str(thisData))
        else:
            for i in range(5):
                i=i+1
                over =  10 ** i
                tmp = thisData/over
                if int(tmp % 10) == 3:
                    print(" "+str(thisData))
                    break
                else:
                    pass
    else:
        if thisData%3 == 0 or thisData%10==3:
            print(" "+str(thisData), end = "")
        else:
            for i in range(5):
                i=i+1
                over =  10 ** i
                tmp = thisData/over
                if int(tmp % 10) == 3:
                    print(" "+str(thisData), end = "")
                    break
                else:
                    pass

Submission status: WA: Presentation Error

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:
            print(" "+str(thisData))
        else:
            for i in range(5):
                i=i+1
                over =  10 ** i
                tmp = thisData/over
                if int(tmp % 10) == 3:
                    print(" "+str(thisData))
                    break
                else:
                    pass
            print(" ")
    else:
        if thisData%3 == 0 or thisData%10==3:
            print(" "+str(thisData), end = "")
        else:
            for i in range(5):
                i=i+1
                over =  10 ** i
                tmp = thisData/over
                if int(tmp % 10) == 3:
                    print(" "+str(thisData), end = "")
                    break
                else:
                    pass

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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="")

Submission status: WA: Presentation Error

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=" ")

Submission status: WA: Presentation Error

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 = " ")

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

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 = " ")

Submission status: WA: Presentation Error

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

Solution code:
n = int(input())
print('',end = " ")
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 = " ")

Submission status: WA: Presentation Error

Solution code:
n = int(input())
print(end = " ")
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 = " ")

Submission status: WA: Presentation Error

Solution code:
n = int(input())
print()
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 = "")

Submission status: WA: Presentation Error

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 = "")

Submission status: WA: Presentation Error

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='')

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
n = int(input())
for i in range(1, n+1):
    if i%3 == 0:print(' '+str(i), end='')
    else:
        if '3' in str(i):print(' '+str(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 or x % 10 == 3) :
		print(" ", i, end = "")
		i += 1
	else :
		i += 1
print()

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

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

Submission status: WA: Presentation Error

Solution code:
def nabeatsu(n):
    if(n % 3 == 0):
        return True
    temp = n
    while(temp > 0):
        if(temp % 10 == 3):
            return True
        temp = temp // 10
    return False

x = int(input())
ans = []
for i in range(x):
    if(nabeatsu(i + 1)):
        ans.append(str(i + 1))
print(' '.join(ans))

Submission status: WA: Presentation Error

Solution code:
def nabeatsu(n):
    if(n % 3 == 0):
        return True
    temp = n
    while(temp > 0):
        if(temp % 10 == 3):
            return True
        temp = temp // 10
    return False

x = int(input())
for i in range(x):
    if(nabeatsu(i + 1)):
        print(' ', i + 1, end = '')

Submission status: WA: Presentation Error

Solution code:
def nabeatsu(n):
    if(n % 3 == 0):
        return True
    temp = n
    while(temp > 0):
        if(temp % 10 == 3):
            return True
        temp = temp // 10
    return False

x = int(input())
for i in range(x):
    if(nabeatsu(i + 1)):
        print(' ', i + 1, end = '')
print()

Submission status: WA: Presentation Error

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 = "")

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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("\n")

Submission status: WA: Presentation Error

Solution code:
n = int(input())

for tmp in range(3, n + 1):
    if tmp % 3 == 0 or str(tmp).find('3') != -1:
        print(tmp, end=' ')

Submission status: WA: Presentation Error

Solution code:
n = int(input())
for tmp in range(3, n + 1):
    if tmp % 3 == 0:
        print(tmp, end=' ')
    else:
        if str(tmp).find('3') != -1:
            print(tmp, end=' ')
print()

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
x = int(input())
k = []
for i in range(1, x + 1):
    y = i
    if i % 3 == 0:
        k.append(i)
    else:
        while y >= 10:
            y %= 10
            if y == 3:
                k.append(i)

for i in range(len(k)):
    print(' '+ str(k[i]), end = '')

Submission status: WA: Presentation Error

Solution code:
x = int(input())
k = []
for i in range(1, x + 1):
    y = i
    if i % 3 == 0:
        k.append(i)
    else:
        while True:
            if y % 10 == 3:
                k.append(i)
                break
            else:
                if y <= 10:
                    break
                else:
                    y //= 10

for i in range(len(k)):
    print(' '+ str(k[i]), end = '')

Submission status: WA: Presentation Error

Solution code:
a = []
i = 1
n = int(input())
def checkNum():
    global a, i, x
    x = i
    if x%3 ==0:
        a.append(x)
        endCheck()
    include3()
    endCheck()

def include3():
    global a, i
    if x%10 == 3:
        a.append(x)
        endCheck()
        
def endCheck():
    global i
    i += 1
    if i <= n:
        checkNum()
        
checkNum()

print(*a)

Submission status: WA: Presentation Error

Solution code:
a = set()
i = 1
n = int(input())
def checkNum():
    global a, i
    x = i
    if x%3 ==0:
        a.add(i)
        if i+1 <= n:
            i += 1
            checkNum()
        print()
    if x%10 == 3:
            a.add(i)
            if i+1 <= n:
                i += 1
                checkNum()
            print()
    x //= 10;
    if x:
        if x%10 == 3:
            a.add(i)
        if i+1 <= n:
            i += 1
            checkNum()
        print()
    if i+1 <= n:
        i += 1
        checkNum()
    print()

    
        
checkNum()

print('',*a)

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='')
  else:
    pass

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='')
  else:
    pass

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="")
  else:
    pass
print()

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="")
  else:
    pass
print()

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="")
  else:
    pass
print()

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="")
  else:
    pass
print()

Submission status: WA: Presentation Error

Solution code:
n = int(input())
x = 1
while x <= 30:
    if(x%3==0 or x%10==3):
        print(x,end=' ')
    x += 1

Submission status: WA: Presentation Error

Solution code:
n = int(input())
x = 1
while x <= 30:
    if(x%3==0 or x%10==3):
        print(' ',end='')
        print(x,end='')
    x += 1

Submission status: WA: Presentation Error

Solution code:
def call(n):
    ans = []

    for x in range(1, n + 1):
        if x % 3 == 0:
            ans.append(x)
            continue

        while x % 10 == 3:
            ans.append(x)
            x //= 10

    return " ".join(map(str, ans))


if __name__ == '__main__':
    from sys import stdin

    n = int(stdin.readline().rstrip())

    print(call(n))

Submission status: WA: Presentation Error

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

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

Submission status: WA: Presentation Error

Solution code:
a = int(input())
for x in range(1,a+1):    
    if x % 3 == 0: 
        print(" {}".format(x),end="")
    else:
        if "3" in str(x):
            print(" {}".format(x),end="")
        else:
            continue

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
n = input()
i = 1
while i <= n:
	if i % 3 == 0:
		print i,
	elif i % 10 == 3:
		print i,
		j = i
		while j == 0:
			j /= 10
			if j % 10 == 3:
				print j,
	i += 1

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
n = input()
print(""),
for i in range(1, n + 1):
    x = i
    if(x % 3 == 0):
        print("%d" %(i)),
        continue
    while(x):
        if(x % 10 == 3):
            print("%d" %(i)),
            break
        x /= 10
print("")

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
def call(n):
    res = []
    for i in range(1, n + 1):
        if i % 3 == 0:
            res.append(str(i))
        elif str(i)[-1] == '3':
            res.append(str(i))
    print(' '.join(res))

call(int(input()))

Submission status: WA: Presentation Error

Solution code:
def call(n):
    res = []
    for i in range(1, n + 1):
        if i % 3 == 0:
            res.append(str(i))
        elif str(i)[-1] == '3':
            res.append(str(i))
    print(' '.join(res).replace('\n', ''))

call(int(input()))

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())

for x in xrange(1,n+1):
	if x % 3 == 0 or x % 10 == 3:
		print x,

print

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())

for x in xrange(1,n+1):
	if x % 3 == 0 or x % 10 == 3:
		print x,

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())

for x in xrange(3,n+1):
	if x % 3 == 0 or x % 10 == 3:
		print x,

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
n = input()
i = 1
while i <= n:
	if i % 3 == 0 or i % 10 == 3:
		print i,
	i += 1

Submission status: WA: Presentation Error

Solution code:
x = input()
o = filter(lambda n: n%3 == 0 or '3' in str(n), range(1,x+1))

print " ".join(map(str,o))

Submission status: WA: Presentation Error

Solution code:
import sys

def call(n):
    i = 1
    flg = 1
    while True:
        x = i
        if x % 3 == 0:
            sys.stdout.write(" "+str(i))
            flg = 0
        while flg == 1:
            if x % 10 == 3:
                sys.stdout.write(" "+str(i))
                flg = 0
            x /= 10
            if not x:
                flg = 0
        if i < n :
            i = i+1
            flg = 1
        else:
            break
n = input()
call(n)

Submission status: WA: Presentation Error

Solution code:
n = int(input())

ans = []
i = 1

while True:
    """CHECK_NUM"""
    x = i
    if x % 3 == 0:
        ans.append(str(i))
    else:
        while True:
            """INCLUDE3"""
            if x % 10 == 3:
                ans.append(str(i))
                break

            x = int(x / 10)
            
            if x != 0: 
                continue
            else: 
                break
    i += 1
    if i <= n:
        continue
    else:
        break

print(" ".join(ans))

Submission status: WA: Presentation Error

Solution code:
n=input()
i=1
while i<=n:
  x=i
  if x%3==0:
    print i,
  else:
    while x:
      if x%10==3:
        print i,
        break
      x/=10
  i+=1
print

Submission status: WA: Presentation Error

Solution code:
n=input()
i=1
SP=[]
while i<=n:
  x=i
  if x%3==0:
    SP.append(str(i))
  else:
    while x:
      if x%10==3:
        SP.append(str(i))
        break
      x/=10
  i+=1
print " ".join(SP)

Submission status: WA: Presentation Error

Solution code:
n=input()
i=1
SP=[]
while i<=n:
  x=i
  if x%3==0:
    SP.append(str(i))
  else:
    while x:
      if x%10==3:
        SP.append(str(i))
        break
      x/=10
  i+=1
print " ".join(SP),

Submission status: WA: Presentation Error

Solution code:
n=input()
i=1
SP=[]
while i<=n:
  x=i
  if x%3==0:
    SP.append(str(i))
  else:
    while x:
      if x%10==3:
        SP.append(str(i))
        break
      x/=10
  i+=1
print " ", " ".join(SP)

Submission status: WA: Presentation Error

Solution code:

num = int(raw_input())

for x in range(1, num + 1):
	if x % 3 == 0 or x % 10 == 3:
		print x,

Submission status: WA: Presentation Error

Solution code:
import sys
num = int(raw_input())

for x in range(1, num + 1):
	if x % 3 == 0 or x % 10 == 3:
		sys.stdout.write(str(x) + " ")

Submission status: WA: Presentation Error

Solution code:
import sys
num = int(raw_input())
print " ",
for x in range(1, num + 1):
	if x % 3 == 0 or x % 10 == 3:
		sys.stdout.write(str(x) + " ")

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())
i=1
x=i
nums = []


def include3():
    global n
    global i
    global x
    global nums

    while True:
        if x % 10 == 3:
            nums.append(str(i))
            if end_check_num():
                return 0
            return 1

        x /= 10
        if x==0:
            if end_check_num():
                return 0
            return 1
    return 1

def end_check_num():
    global n
    global i
    global x

    i+=1
    if i <= n:
        return False
    return True


while True:
    x=i
    if x % 3==0:
        nums.append(str(i))
        if end_check_num():
            break
        continue
    if 0==include3():
        break

print " ".join(nums)

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())
i=1
x=i
nums = []


def include3():
    global n
    global i
    global x
    global nums

    while True:
        if x % 10 == 3:
            nums.append(str(i))
            if end_check_num():
                return 0
            return 1

        x /= 10
        if x==0:
            if end_check_num():
                return 0
            return 1
    return 1

def end_check_num():
    global n
    global i
    global x

    i+=1
    if i <= n:
        return False
    return True


while True:
    x=i
    if x % 3==0:
        nums.append(str(i))
        if end_check_num():
            break
        continue
    if 0==include3():
        break

print " ".join(nums).rstrip()

Submission status: WA: Presentation Error

Solution code:
n = int(raw_input())
i=1
x=i
nums = []


def include3():
    global n
    global i
    global x
    global nums

    while True:
        if x % 10 == 3:
            nums.append(str(i))
            if end_check_num():
                return 0
            return 1

        x /= 10
        if x==0:
            if end_check_num():
                return 0
            return 1
    return 1

def end_check_num():
    global n
    global i
    global x

    i+=1
    if i <= n:
        return False
    return True


while True:
    x=i
    if x % 3==0:
        nums.append(str(i))
        if end_check_num():
            break
        continue
    if 0==include3():
        break

print " ".join(nums).rstrip()
print ""

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
n=int(raw_input())
i = 1
while(i<=n):
    if i%3 is 0:
        print i,
    elif i%10 is 3:
        print i,
    i = i+1

Submission status: WA: Presentation Error

Solution code:
n=int(raw_input())
i = 1
while(i<=n):
    if i%3 is 0:
        print i,
    elif i%10 is 3:
        print i,
    i = i+1
print

Submission status: WA: Presentation Error

Solution code:
n=int(raw_input())
i = 1
while(i<n):
    if i%3 is 0:
        print i,
    elif i%10 is 3:
        print i,
    i = i+1
print n

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
n = int(input())
a = []
for x in range(3,n):
    if x % 3 == 0 or x % 10 == 3:
        print(x, '', end='')
print(n)

Submission status: WA: Presentation Error

Solution code:
n = int(input())
a = []
for x in range(3,n):
    if x % 3 == 0 or x % 10 == 3:
        print(x, '', end='')
print(n, 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(i,end=' ')
print('')

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:
    if i == n:
      print(i)
    else:
      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:
    if i == n:
      print(i)
    else:
      print(i,end=' ')
print('')

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:
    if n == 3:
      print(i,end='')
    else:
      print(' ' + str(i),end='')
print('')

Submission status: WA: Presentation Error

Solution code:

array = []
for i in range(3,int(input()) + 1):
  if i % 3 == 0 or i % 10 == 3:
    array.append(i)
for i in array:
  print('',"{0}".format(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:
    if n == 3:
      print(i,end='')
    else:
      print(' ' + str(i),end='')
print()

Submission status: WA: Presentation Error

Solution code:
array = []
for i in range(3,int(input()) + 1):
  if i % 3 == 0 or i % 10 == 3 or i - 30 > 10:
    array.append(i)
for i in array:
  print('', i, end='')

Submission status: WA: Presentation Error

Solution code:
array = []
for i in range(3,int(input()) + 1):
  if i % 3 == 0 or i % 10 == 3 or 0 <= i - 30 < 10:
    array.append(i)
for i in array:
  print('',"{0}".format(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 or '3' in str(i):
    if i == 3:
      print('', i, end=' ')
    elif i == n:
      print(i)
    else:
      print(i, end=' ')

Submission status: WA: Presentation Error

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

	while x != 0:
		if x % 10 == 3:
			print('{0}'.format(i), end=' ')
		break
	x //= 10
print()

Submission status: WA: Presentation Error

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

	while x != 0:
		if x % 10 == 3:
			print('{0}'.format(i), end=' ')
		break
	x //= 10

print()

Submission status: WA: Presentation Error

Solution code:
n = input()
array = []
for x in range(1, n + 1):
    if x % 3 == 0 or x % 10 == 3:
        array.append(x)
print str(array).replace('[', '').replace(']', '').replace(',', '')

Submission status: WA: Presentation Error

Solution code:
from sys import stdin
n = int(stdin.readline())
for i in range(1,n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            print('{0}'.format(i),end='')
            continue

        while x != 0:
            if x % 10 == 3:
                print('{0}'.format(i),end='')
            break
print()

Submission status: WA: Presentation Error

Solution code:
x = input()
y= []
for i in range(x+1):
	if i == 0:
		continue
	if i % 3 == 0:
		y.append(str(i))
	else:
		z = i
		while 1:
			if z < 10:
				break
			else:
				z -= 10
		if z == 3:
			y.append(str(i))
print " ".join(y)

Submission status: WA: Presentation Error

Solution code:
# Python 3

def PrintI(i):
	print(" ", i)
	return i + 1

if __name__ == "__main__":
	n = input()
	n = int(n)
	s = ""
	for i in range(1, n + 1):
		if i % 3 == 0:
			s += " " + str(i)
		elif i % 10 == 3:
			s += " " + str(i)
	print(s[1:])

Submission status: WA: Presentation Error

Solution code:
n=int(raw_input())
for n in range(1,n+1):
	if n%3==0:
		print n,
	elif n%10==3:
		print n,
	elif n/100==3:
		print n,
	elif n/1000==3:
		print n,

Submission status: WA: Presentation Error

Solution code:
n=int(raw_input())
for n in range(1,n+1):
	if n%3==0:
		print n,
	elif n%10==3:
		print n,
	elif n/10==3:
		print n,
	elif n/100==3:
		print n,
	elif n/1000==3:
		print n,

Submission status: WA: Presentation Error

Solution code:
import sys
n=int(input())
for i in range(1,n+1):
	if(i%3==0 or i%10==3):
		i=str(i)
		sys.stdout.write(' '+i)
		i=int(i)

Submission status: WA: Presentation Error

Solution code:
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import sys
import io
import re
import math
import itertools
#sys.stdin=file('input.txt')
#sys.stdout=file('output.txt','w')
#10**9+7
mod=1000000007
#mod=1777777777
pi=3.141592653589
xy=[(1,0),(-1,0),(0,1),(0,-1)]
bs=[(-1,-1),(-1,1),(1,1),(1,-1)]
#start = time.clock()
n=int(raw_input())
for i in range(3,n+1):
    if i%3==0 or '3' in str(i):
        print ' '+str(i),

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
# coding: utf-8

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

Submission status: WA: Presentation Error

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

Submission status: WA: Presentation Error

Solution code:
def call(i, n):
	while 1:
		if i > n:
			print
			break
		if i % 3 == 0:
			print i,
			i += 1
			continue
		if i % 10 == 3:
			print i,
			i += 1
			continue
		i += 1




if __name__ == '__main__':
	n = int(raw_input())
	print " ",
	call(1, n)

Submission status: WA: Presentation Error

Solution code:
def call(n):
	print(' '),
	for i in xrange(1, n+1):
		if i % 3 == 0:
			print(i),
		elif i % 10 == 3:
			print(i),
	print


n = int(raw_input())
call(n)

Submission status: WA: Presentation Error

Solution code:
def call(n):
    i = 1
    while i <= n:
        x = i
        if x % 3 == 0:
            print " " + str(i),
            i += 1
            continue

        while x:
            if x % 10 == 3:
                print " " + str(i),
                break
            x /= 10
            
        i += 1
        
    print 

n = int(raw_input())
call(n)