class Solution(object):

    def kthFactor(self, n, k):
        cnt = 0
        for i in xrange(1, n + 1):
            if n % i == 0:
                cnt += 1
                if cnt == k:
                    return i
        return -1

977aeb8c7b03f84ca2d144f1d9543001f3142088
<mask token>

class Solution(object):
    <mask token>

class Solution(object):

    def kthFactor(self, n, k):
        cnt = 0
        for i in xrange(1, n + 1):
            if n % i == 0:
                cnt += 1
                if cnt == k:
                    return i
        return -1
