qyliang/CodeNanoFix huggingface dataset:
Buggy code:
#In[]:
import math

n, d = map(int,input().split())
x = [list(map(int,input().split())) for _ in range(n)]

ans = 0
for i in range(n):
    num = (x[i][0])*(x[i][0]) * (x[i][1])*(x[i][1])
    root_num = math.sqrt(num)
    if num >= d:
        ans += 1
print(ans)

Fixed code:
#In[]:
import math

n, d = map(int,input().split())
x = [list(map(int,input().split())) for _ in range(n)]

ans = 0
for i in range(n):
    num = (x[i][0])*(x[i][0]) + (x[i][1])*(x[i][1])
    root_num = math.sqrt(num)
    if root_num <= d:
        ans += 1
print(ans)
Buggy code:
n, d = map(int, input().split())
cnt = 0
for ti in range(n) :
  x, y = map(int, input().split())
  dist = (x**2 + y**2)**0.5
  if(dist >= d):
    cnt += 1
    
print(cnt)

Fixed code:
n, d = map(int, input().split())
cnt = 0
for ti in range(n) :
  x, y = map(int, input().split())
  dist = (x**2 + y**2)**0.5
  if(dist <= d):
    cnt += 1
    
print(cnt)
Buggy code:
import math

n,d = map(str,input().split())
answer = 0
for i in range(n):
  x,y = map(str,input().split())
  if math.sqrt(x**2 + y**2) <= d:
    answer += 1
    
print(answer)

Fixed code:
import math
 
n,d = map(int,input().split())
answer = 0
for i in range(n):
  x,y = map(int,input().split())
  if math.sqrt(x**2 + y**2) <= d:
    answer += 1
    
print(answer)
Buggy code:
N,D=map(int,input().split())
ans=0
for i in range(N):
    x,y=map(int,input().split())
    if x^2 + y^2<=D^2:
        ans+=1
print(ans)



Fixed code:
N,D=map(int,input().split())
ans=0
for i in range(N):
  x,y=map(int,input().split())
  if x**2+y**2<=D**2:
    ans+=1
print(ans)
Buggy code:
n,d=input().split()
a=[]
for x in range(int(n)):
    x,y=input().split()
    print((((int(x)**2)+(int(y)**2))**0.5))
    if (((int(x)**2)+(int(y)**2))**0.5)==float(int(d)):
        a.append(1)
print(len(a))


Fixed code:
n,d=input().split()
a=[]
for x in range(int(n)):
    x,y=input().split()
    if (((int(x)**2)+(int(y)**2))**0.5)<=float(int(d)):
        a.append(1)
print(len(a))
Buggy code:
line = input().split()
number = int(line[0])
distance = int(line[1])
import math
cnt =0
print(number)
for i in range(number):
  position = input().split()
  x = int(position[0])
  y = int(position[1])
  origin_dis = math.sqrt(x*x+y*y)
  if origin_dis <=distance:
    cnt +=1
print(cnt)

Fixed code:
line = input().split()
number = int(line[0])
distance = int(line[1])
import math
cnt =0
for i in range(number):
  position = input().split()
  x = int(position[0])
  y = int(position[1])
  origin_dis = math.sqrt(x*x+y*y)
  if origin_dis <=distance:
    cnt +=1
print(cnt)
Buggy code:
import math

def dist(x, y):
  math.sqrt(x ^ 2 + y ^ 2)

(n, d) = map(int, input().split())
res = 0

for _ in range(n):
  (x, y) = map(int, input().split())
  res += 1 if dist(x, y) <= d else 0
  
print(res)

Fixed code:
import math

def dist(x, y):
  return math.sqrt(x ** 2 + y ** 2)

(n, d) = map(int, input().split())
res = 0

for _ in range(n):
  (x, y) = map(int, input().split())
  res += 1 if dist(x, y) <= d else 0

print(res)
Buggy code:
n, d = map(int,input().split())
cnt = 0
for i in range(n):
    p,q = map(int,input().split())
    if d <= (p**2)+(q**2):
        cnt+=1
print(cnt)

Fixed code:
n, d = map(int,input().split())
cnt = 0
for i in range(n):
    p,q = map(int,input().split())
    if p*p + q*q <= d*d:
        cnt+=1
print(cnt)
Buggy code:
import numpy as np


N, D = map(int,input().split())

num = 0

for n in range(N):
    x,y =  map(int,input().split())
    d = np.sqrt(x**2 + y**2)
    if d >= D:
        num+=1

print(num)

Fixed code:
import numpy as np

N, D = map(int,input().split())

num = 0

for n in range(N):
    x,y =  map(int,input().split())
    d = np.sqrt(x**2 + y**2)
    if d <= D:
        num+=1

print(num)
Buggy code:
import math

n,d=map(int,input().split())
count=0
for i in range(n):
  x,y = map(int, input().split())
  if math.sqrt((x**2)+(y**2))<=d:
   count=+1
print(count)

Fixed code:
import math
total = 0
n, d = map(int, input().split())
for i in range(n):
  x, y  =  map(int, input().split())
  distance = math.sqrt(x**2 + y**2)
  if distance <= d:
    total += 1
print(total)
Buggy code:
n,d=map(int,input().split())
ans=0
for i in range(n):
    x,y=map(int,input().split())
    if x**2+y**2<=d*2:
        ans+=1
print(ans)

Fixed code:
ans = 0
n, d = map(int, input().split())
for _ in range(n):
    x, y = map(int, input().split())
    if (x ** 2 + y ** 2) <= d**2:
        ans += 1
print(ans)
Buggy code:
N, D = map(int, input().split())

count = 0

for i in N:
  x, y = map(int, input().split())
  if D > pow(x**2+y**2, 0.5):
    count += 1
  else:
    continue
    
print(count)

Fixed code:
N, D = map(int, input().split())

count = 0

for i in range(N):
    x, y = map(int, input().split())
    if D >= pow(x**2+y**2, 0.5):
        count += 1
    
print(count)
Buggy code:
count=0
N,D=map(int,input().split())
while N:
    X, Y = map(int, input().split())
    if X * X + Y * Y - 25 > 0:
        pass
    else:
        count += 1
    N-=1
print(count)

Fixed code:
count=0
N,D=map(int,input().split())
while N:
    X, Y = map(int, input().split())
    if X * X + Y * Y - D*D > 0:
        pass
    else:
        count += 1
    N-=1
print(count)
Buggy code:
import math

list = input().split(' ')
num = int(list[0])
d = int(list[1])
ans = 0

for i in num:
  list2 = input().split(' ')
  x = list2[0]
  y = list2[1]
  distance = math.sqrt(x**2 + y**2)
  if distance <= d:
    ans += 1

print(ans)

Fixed code:
import math

list = input().split(' ')
num = int(list[0])
d = int(list[1])
ans = 0

for i in range(num):
  list2 = input().split(' ')
  x = int(list2[0])
  y = int(list2[1])
  distance = math.sqrt(x**2 + y**2)
  if distance <= d:
    ans += 1

print(ans)
Buggy code:
#200802C
X = int(input())
L = len(str(X))
#print(L)



for l in range(L):
    Y += 7*10**l
    
flag = 0
for i in range(10000000):
    Y = Y%X
    #print(i)

    if Y == 0:
        ans = L+i
        flag = 1
        break
    else: 
        Z = Y * 10 + 7
        if Z == Y:
            break
        else:
            Y = Z

if flag == 0:
    print("-1")
else:
    print(ans)


Fixed code:
#200802C
X = int(input())
L = len(str(X))
#print(L)


Y = 0

for l in range(L):
    Y += 7*10**l
    
flag = 0
for i in range(1000000):
    Y = Y%X
    #print(i)

    if Y == 0:
        ans = L+i
        flag = 1
        break
    else: 
        Z = Y * 10 + 7
        if Z == Y:
            break
        else:
            Y = Z

if flag == 0:
    print("-1")
else:
    print(ans)
Buggy code:
K = int(input())

sevens = int('7' * len(str(K)))
flag = False
for i in range(K):
    if sevens % K == 0:
        flag = True
        break
    sevens = sevens * 10 + 7
print(len(str(sevens)) if flag else -1)


Fixed code:
K = int(input())

#sevens = int('7' * len(str(K)))
sevens_mod = 7 % K
flag = False
ans = -1
for i in range(K):
    if sevens_mod == 0:
        flag = True
        ans = i + 1
        break
    sevens_mod = (sevens_mod * 10 + 7) % K
print(ans if flag else -1)
Buggy code:
k=int(input())
if k%2==0 k%5==0:
    print(-1)
    exit()
a=0
for i in range(k):
    a=(a*10+7)%k
    if a==0:
        print(i+1)
        exit()

Fixed code:
k=int(input())
if k%2==0 or k%5==0:
    print(-1)
    exit()
a=0
for i in range(k):
    a=(a*10+7)%k
    if a==0:
        print(i+1)
        exit()
Buggy code:
import datetime
import string
import re
import math

K=int(input())
if K % 2 == 0 or K % 5 == 0:
    print("-1")
else:
    s = 7
    count = 1
    while True:
        if s % K == 0:
            print(count)
            break
        else:
            count += 1
            s = 10*s + 7

Fixed code:
import datetime
import string
import re
import math

K=int(input())
if K % 2 == 0 or K % 5 == 0:
    print("-1")
else:
    s = 7
    count = 1
    while True:
        if s % K == 0:
            print(count)
            break
        else:
            count += 1
            s = (s % K)*10 + 7
Buggy code:
k = int(input())

tmp = 7
ans = -1
for i in range(1,10**6):  
  if tmp % k == 0:
    ans = i
    break
  tmp *= 10
  tmp += 7
print(ans)    

Fixed code:
k = int(input())

tmp = 7
ans = -1
for i in range(1,10**6):  
  if tmp % k == 0:
    ans = i
    break
  tmp *= 10
  tmp = (tmp+7) % k
print(ans)
Buggy code:
K=int(input())
s=0

for _ in range(K):
    print(10*s+7, s)
    s=(10*s+7)%K
    if s==0:
        print(_+1)
        exit()
        
print(-1)


Fixed code:
K=int(input())
s=0

for _ in range(K):
    s=(10*s+7)%K
    if s==0:
        print(_+1)
        exit()
        
print(-1)
Buggy code:
K = int(input())
if K % 2 == 0:
    print(-1)
    exit()
if K % 5 == 0:
    print(-1)
    exit()

x = 7
counter = 1
while (True):
    if x%K == 0:
        print(counter)
        exit()
    x += 7 * 10 ** counter
    counter += 1


Fixed code:
K = int(input())
if K%5 == 0 or K%2 == 0:
    print(-1)
    exit()
x = 7
counter = 1
while True:
    if x%K == 0:
        print(counter)
        exit()
    counter += 1
    x = (10 * x + 7) % K
Buggy code:
K = int(input())

cnt=1
Num=7
while True:
  if K%2==0:
    print('-1')
    break
  if Num%K==0:
    print(cnt)
    break
  else:
    Num+=7*10**cnt
    cnt+=1
    



Fixed code:
K = int(input())

cnt=1
Num=7%K
while cnt<=K:
  if K%2==0:
    print('-1')
    break
  if Num%K==0:
    print(cnt)
    break
  else:
    Num = (10*Num + 7)%K
    cnt+=1
else:
  print('-1')
Buggy code:
k = int(input())
c = 0
if k%2 ==0 or k%5==0:
    print(-1)
    c=1
elif k==1:
    print(1)
    c=1
if c==0:
    t = 7

    for i in range(k):
        if int(t)%k==0 :
            print(i+1)
            break
        t = (10*t+7)

Fixed code:
k = int(input())
c = 0
if k%2 ==0 or k%5==0:
    print(-1)
    c=1
elif k==1:
    print(1)
    c=1
if c==0:
    t = 7

    for i in range(k):
        if int(t)%k==0 :
            print(i+1)
            break
        t = (10*t+7)%k
Buggy code:
K=int(input())
a=7
count=1
for i in range(K):
    if a%K==0:
        print(count)
        break
    a=a*10+7
    count+=1
if count==K+1:
    print(-1)


Fixed code:
K=int(input())
a=7
count=1
for i in range(K):
    if a%K==0:
        print(count)
        break
    a=(a*10+7)%K
    count+=1
if count==K+1:
    print(-1)
Buggy code:
k = int(input())

if k % 2 == 0 or k % 5 ==0:
  print(-1)
else:
  n = 7
  cnt = 1
  for i in range(k):
    n = (n * 10 +7) % k
    if n % k==0:
      break
      
    cnt +=1
    
print(cnt)    
    
    

Fixed code:

k = int(input())

if k % 2 == 0 or k % 5 == 0:
    print(-1)
else:
    n = 7
    cnt = 1
    for i in range(k):
        if n % k == 0:
            break
        cnt += 1
        n = (n * 10 + 7) % k
    print(cnt)
Buggy code:
K = int(input())
a = 0
for i in range(10**K):
    a += 7*(10**i)
    a = a % K
    if a == 0:
        print(i+1)
        exit()
print(-1)

Fixed code:
K = int(input())
a = 0
for i in range(K):
    a = (10*a+7)%K
    if a == 0:
        print(i+1)
        exit()
print(-1)
Buggy code:
n = int(input())
ans = 1
if n % 5 == 0 or n % 2 == 0:
    print(-1)
else:
    t = 7
    while t % n != 0:
        t = t * 10 + 7
        t %= n
        ans += 1
print(ans)

Fixed code:
n = int(input())
ans = 1
if n % 5 == 0 or n % 2 == 0:
    print(-1)
else:
    t = 7
    while t % n != 0:
        t = t * 10 + 7
        t %= n
        ans += 1
    print(ans)
Buggy code:
import sys
k = int(input())
if k %2 == 0:
    print(-1)
    sys.exit()

num = 0

for i in range(k+1):
    num += 7*(10**i)
    if num %k == 0:
        print(i+1)
        sys.exit()
print(-1)


Fixed code:
import sys
k = int(input())

num = 0
for i in range(k + 1):
    num = (num*10+7)%k
    if num == 0:
        print(i + 1)
        sys.exit()
print(-1)
Buggy code:
K = int(input())
i = 1
N = 0
if K%2==0:
    print(-1)
    exit()
while(i<1000000):
    N += 7*(10**(i-1))
    if N%K == 0:
        print(i)
        exit()
    i += 1
print(-1)

Fixed code:
K = int(input())
i = 1
N = 0
if K%2==0:
    print(-1)
    exit()
while(i<1000000):
    N = N*10+7
    N %= K
    if N == 0:
        print(i)
        exit()
    i += 1
print(-1)
Buggy code:
if __name__ == '__main__':

	k = int(input())
	x = 1
	for i in range(10**6):
		if x == 0:
			print(i)
			exit()
		x = (10 * x + 7) % k


Fixed code:
if __name__ == '__main__':

	k = int(input())
	x = 0
	for i in range(10**6):
		x = (10 * x + 7) % k
		if x == 0:
			print(i+1)
			exit()
	print(-1)
Buggy code:
import sys
input - sys.stdin.readline
def main():
    K = int(input())
    
    if K%2==0:
        print(-1)
        return
    
    if K % 7:
        L = 9*K
    else:
        L = 9*K//7
    a = 1
    for i in range(1,K+10):
        a = (a * 10) % L
        if a == 1:
            print(i)
            return
    print(-1)
main()

Fixed code:
import sys
input = sys.stdin.readline

def main():
    K = int(input())
    
    if K%2==0:
        return -1
    
    if K % 7:
        L = 9*K
    else:
        L = 9*K//7
    a = 1
    for i in range(1,L+1):
        a = (a * 10) % L
        if a == 1:
            return i
    return -1
ans =main()
print(ans)
Buggy code:
from collections import defaultdict,deque
from sys import stdin,setrecursionlimit
import heapq,bisect,math,itertools,string,queue,copy
setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, stdin.readline().split()))


K = int(input())
def main():
    k = 7
    count = 1
    if K %2==0:
        print(-1)
        return
    while True:
        if k % K == 0:
            print(count)
            return
        k = (k+7*(10**count))%K
        count += 1


main()


Fixed code:
from collections import defaultdict,deque
from sys import stdin,setrecursionlimit
import heapq,bisect,math,itertools,string,queue,copy
setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, stdin.readline().split()))


K = int(input())
def main():
    k = 7
    count = 1
    re = 1
    if K % 2==0:
        print(-1)
        return
    while True:
        if k % K == 0:
            print(count)
            return
        re =  (re*10)%K
        k = (k+7*re)%K
        count += 1
        if count >= 10**7:
            print(-1)
            return


main()
Buggy code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import lru_cache
import bisect
import re
import queue
import copy
import decimal


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


def solve():
    K = Scanner.int()
    if K % 2 == 0:
        print(-1)
    X = 7
    cnt = 1
    while True:
        if X % K == 0:
            print(cnt)
            return
        cnt += 1
        X = X * 10 + 7
        X %= K


def main():
    # sys.setrecursionlimit(1000000)
    # sys.stdin = open("sample.txt")
    solve()


if __name__ == "__main__":
    main()


Fixed code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import lru_cache
import bisect
import re
import queue
import copy
import decimal


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


def solve(K):
    if K % 2 == 0 or K % 5 == 0:
        print(-1)
        return
    X = 7
    cnt = 1
    while True:
        if X % K == 0:
            print(cnt)
            return
        cnt += 1
        X = X * 10 + 7
        X %= K


def main():
    # sys.setrecursionlimit(1000000)
    # sys.stdin = open("sample.txt")
    K = Scanner.int()
    solve(K)


if __name__ == "__main__":
    main()
Buggy code:
k = int(input())
if k % 2 == 0:
    print(-1)
else:
    val = 0
    for i in range(10**6):
        val = val * 10 + 7
        if val % k == 0:
            print(i+1)
            break

Fixed code:
k = int(input())
if k % 2 == 0:
    print(-1)
else:
    val = 0
    for i in range(10**6+1):
        val = (val * 10 + 7) % k
        if val % k == 0:
            print(i+1)
            break
        elif i == 10**6:
            print(-1)
Buggy code:
k=int(input())
cnt=1
flag=True
if k%2==0:
    print(-1)
else:
    keta=10
    tmp=0
    while cnt<=10**6:
        tmp+=pow(keta,cnt-1,k)*7
        if tmp%k==0:
            print(cnt)
            flag=False
            break
        cnt+=1
if flag:
    print(-1)

Fixed code:
k=int(input())
cnt=1
flag=True
if k%2==0:
    flag=False
    print(-1)
else:
    keta=10
    tmp=0
    while cnt<=10**6:
        tmp+=pow(keta,cnt-1,k)*7
        if tmp%k==0:
            print(cnt)
            flag=False
            break
        cnt+=1
if flag:
    print(-1)
Buggy code:
k = int(input())
l = []
if 7 % k == 0:
    print(1)
    exit(0)
l.append(7 % k)
for i in range(1,k+1):
    a = (10 * l[i-1] + 7)
    print(a)
    if a % k == 0:
        print(i+1)
        exit(0)
    else:
        l.append(a)
print(-1)    

Fixed code:
k = int(input())
l = []
if 7 % k == 0:
    print(1)
    exit(0)
l.append(7 % k)
for i in range(1,k):
    a = (10 * l[i-1] + 7)
    if a % k == 0:
        print(i+1)
        exit(0)
    else:
        l.append(a % k)
print(-1)
Buggy code:
K = int(input())

N=7
NotFound = True

for i in range(K):
  if N%K == 0:
    NotFound = False
    print(i+1)
    break
  N=N*10+7

if (NotFound):
  print(-1)

Fixed code:
K = int(input())

N=7%K
NotFound = True

for i in range(K):
  if N == 0:
    NotFound = False
    print(i+1)
    break
  N=(N*10+7)%K

if (NotFound):
  print(-1)
Buggy code:
k = int(input())
s = 7

cnt = 0
if k % 2 == 1 and not k % 5 == 0:
    while(1):
        if s == 0:
            cnt += 1
            print(cnt)
            break
        else:
            s = (s * 10 + 7) % k
            cnt += 1

Fixed code:
k = int(input())
s = 7
s = s % k
cnt = 0
if k % 2 == 1 and not k % 5 == 0:
    while(1):
        if s == 0:
            cnt += 1
            print(cnt)
            break
        else:
            s = (s * 10 + 7) % k
            cnt += 1
else:
    print(-1)
Buggy code:
K = int(input())

if K % 2 == 0　or K % 5 == 0:
  print(-1)
else:
  if K % 7 == 0:
    L = 9 * K // 7
  else:
    L = 9 * K
  a = 10 % L
  check = False
  for i in range(L):
    a %= L
    if a == 1:
      print(i + 1)
      check = True
      break
    a *= 10
  if not check:
    print(-1)

Fixed code:
K = int(input())

if K % 2 == 0 or K % 5 == 0:
  print(-1)
else:
  if K % 7 == 0:
    L = 9 * K // 7
  else:
    L = 9 * K
  a = 10 % L
  check = False
  for i in range(L):
    a %= L
    if a == 1:
      print(i + 1)
      check = True
      break
    a *= 10
  if not check:
    print(-1)
Buggy code:
N = int(input())
a=0
flag=0
for i in range(1,10**6):
    a+=7*10**(i-1)
    if a%N==0:
        print(i)
        flag=1
        break
if flag==0:
    print(-1)

Fixed code:
N = int(input())
a=0
flag=0
for i in range(1,N+1):
    a=(a*10+7)%N   
    if a==0:
        print(i)
        flag=1
        break

if flag==0:
    print(-1)
Buggy code:
K = int(input())

a = 7

for i in range(1, K):
    if a % K == 0:
        print(i)
        break
    else:
        a = (10 * a + 7) % K

Fixed code:
K = int(input())

a = 7

for i in range(K):
    if a % K == 0:
        print(i + 1)
        break
    a = (10 * a + 7) % K
else:
    print(-1)
Buggy code:
K = int(input())
if K % 2 == 0 or K % 5 == 0:
    print(-1)

cnt = 1
cur = 7
while True:
    if cur % K == 0:
        print(cnt)
        break
    if cnt > K:
        print('-1')
        break
    cur = (cur * 10 + 7) % K
    cnt += 1

Fixed code:
K = int(input())
if K % 2 == 0 or K % 5 == 0:
    print('-1')
else:
    cnt = 1
    cur = 7
    while True:
        if cur % K == 0:
            print(cnt)
            break
        if cnt > K:
            print('-1')
            break
        cur = (cur * 10 + 7) % K
        cnt += 1
Buggy code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

K = INT()

checked = [0]*K

a = 0
for i in range(1, K):
	a += 7*pow(10, i-1, K)
	a %= K
	if a == 0:
		print(i)
		break
	elif checked[a]:
		print(-1)
		break


Fixed code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

K = INT()

tmp = 7
ans = 1
p = 1
mo = tmp%K
checked = [0]*(K+1)
checked[mo] = 1
while mo != 0:
	mo += 7*pow(10, p, K)
	mo %= K
	p += 1
	if checked[mo]:
		print(-1)
		break
	checked[mo] = 1
else:
	print(p)
Buggy code:
K = int(input())

N = 0

for i in range(K):
    N += 7*(10**i)
    if N%K ==0:
        print(i)
        break
else:
    print(-1)

Fixed code:
K = int(input())

num = 7%K

for i in range(K):
  if num%K ==0:
    print(i+1)
    break
  else:
    num = (num*10 + 7)%K
    
else:
  print(-1)
Buggy code:
K = int(input())

sevens = 7
count = 0

while(sevens % K !=0):
  count += 1
  sevens = sevens * 10 + 7
  if count > K:
    print(-1)
	break
    
print(count)

Fixed code:
K = int(input())
 
sevens = 7 % K
count = 1
 
while(sevens % K !=0):
  sevens = sevens * (10 % K) + (7 % K)
  sevens = sevens % K
  count += 1
  if count > K:
    count = -1
    break
    
print(count)
Buggy code:
K = int(input())

N = 0

for i in range(10001):
    N += 7*(10**i)
    if N%K ==0:
        print(i)
        break
    else:
        print(-1)


Fixed code:
K = int(input())

for i in range(K):
    if i == 0:
        N= 7%K
    else:
        N = (10*N+7)%K
    if N == 0:
        print(i+1)
        break
else:
    print(-1)