Buggy python submission (verdict: Time Limit Exceeded):
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


Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
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


Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1

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


Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
n = int(input())
i = 1

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


Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
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


Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
n = int(input())
i = 1

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


Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
n = int(input())
i = 1

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


Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1

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


Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1

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


Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1

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


Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1

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


Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret == " " + str(i)
        i+=1
        if i > n:
            print(ret)
            break
    if x % 10 == 3:
        ret == " " + str(i)
        i+=1
        if i > n:
            print(ret)
            break
    else:
        x /= 10
        if x != 0:
            if x % 10 == 3:
                ret == " " + str(i)
                i+=1
                if i > n:
                    print(ret)
                    break


Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret = " " + str(i)
        i+=1
        if i > n:
            print(ret)
            break
    if x % 10 == 3:
        ret = " " + str(i)
        i+=1
        if i > n:
            print(ret)
            break
    else:
        x /= 10
        if x != 0:
            if x % 10 == 3:
                ret = " " + str(i)
                i+=1
                if i > n:
                    print(ret)
                    break


Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret = " " + str(i)
        i+=1
        if i > n:
            print(ret)
            break


Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret += " " + str(i)
        i+=1
        if i > n:
            print(ret)
            break


Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
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
        while x /= 10 > 0:
        if x % 10 == 3:
            ret += " " + str(i)
    i+=1
    if i > n:
        break

print(ret)



Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
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:
        while x /= 10 > 0:
        if x % 10 == 3:
            ret += " " + str(i)
    i+=1
    if i > n:
        break

print(ret)



Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
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)



Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
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)



Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
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)



Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
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
                if x == 0:
                    break
    i+=1
    if i > n:
        break

print(ret)



Fixed submission:
#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()