Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

A,B,K=map(int,input().split())
for i in range(A,B+1):
    if i<A+K or i>B-K:
        print(i)


### FIXED CODE ###

A,B,K=map(int,input().split())
ANS=[]
for i in range(A,A+K):
    if i<=B:
        ANS.append(i)

for i in range(B,B-K,-1):
    if i>=A:
        ANS.append(i)

for i in sorted(list(set(ANS))):
    print(i)
### BUGGY CODE ###

N = int(input())
A = [int(i) for i in input().split()]
count = 0
flag = 1
while flag != 0:
    flag = 0
    for i, a in enumerate(A):
        if a % 2 == 0:
            A[i] = a/2
            count += 1
            flag = 1
            break
print(count)


### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
count = 0
flag = 1
while flag != 0:
    flag = 0
    for i, a in enumerate(A):
        if a % 2 == 0:
            A[i] = a/2
            count += 1
            flag = 1
print(count)
### BUGGY CODE ###

K = int(input())
total = 0

def gcd2(a,b): #互除法
  while True:
    mod = a % b
    if mod == 0:
      return b
    a = b
    b = mod

memo = {}
def gcd(a,b,c):
  a,b,c = sorted([a,b,c])
  if (a,b,c) not in memo:
    val = gcd2(gcd2(a,b), c)
    memo[(a,b,c)] = val
    return val
  return memo[(a,b,c)]

for a in range(1, K+1):
  for b in range(1, K+1):
    for c in range(1, K+1):
      g = gcd(a, b, c)
#      print(a,b,c, g)
      total += g

print(total)

### FIXED CODE ###

K = int(input())
total = 0

def gcd2(a,b): #互除法
  while True:
    mod = a % b
    if mod == 0:
      return b
    a = b
    b = mod

memo = {}
def gcd(a,b,c):
  return gcd2(gcd2(a,b),c)
#  a,b,c = sorted([a,b,c])
#  if (a,b,c) not in memo:
#    val = gcd2(gcd2(a,b), c)
#    memo[(a,b,c)] = val
#    return val
#  return memo[(a,b,c)]

for a in range(1, K+1):
  for b in range(1, K+1):
    for c in range(1, K+1):
      g = gcd(a, b, c)
#      print(a,b,c, g)
      total += g

print(total)
### BUGGY CODE ###

import fractions as fr
k = int(input())
ans = (k+1)*k//2
for i in range(1, k+1):
  for j in range(1, k+1):
    if i == j:
      continue
    else:
      ans += 3*fr.gcd(i, j)
for i in range(1, k-1):
  for j in range(i+1, k):
    for l in range(j+1, k+1):
      te = fr.gcd(i,j)
      tee= fr.gcd(te,l)
      ans+= 6*tee
print(ans)

### FIXED CODE ###

import fractions as fr
k = int(input())
ans = (k+1)*k//2
tttt = [[0]*(k+1) for _ in range(k+1)]
for i in range(1, k+1):
  for j in range(1, k+1):
    if i == j:
      continue
    else:
      if tttt[i][j] != 0:
        g = tttt[i][j]
        ans += 3*g
      else:
        g = fr.gcd(i,j)
        tttt[i][j] = g
        tttt[j][i] = g
        ans += 3*g
for i in range(1, k-1):
  for j in range(i+1, k):
    for l in range(j+1, k+1):
      temp = tttt[i][j]
      temp2 = tttt[temp][l]
      ans+= 6*temp2
print(ans)
### BUGGY CODE ###

from bisect import bisect
from itertools import accumulate


def solve(v, w):
    vl = bisect(table, v)
    wl = bisect(table, w)
    if vl > wl:
        for i in range(vl - wl):
            v = (v + m) // n
    elif wl < vl:
        for i in range(wl - vl):
            w = (w + m) // n
    while v != w:
        if v > w:
            v, w = w, v
        w = (w + m) // n
    return v


n, q = map(int, input().split())
m = n - 2
table, k = [], 1
while True:
    table.append(k)
    k *= n
    if k > 1e9:
        break
table = list(accumulate(table))

print('\n'.join(map(str, (solve(*map(int, input().split())) for _ in range(q)))))


### FIXED CODE ###

n, q = map(int, input().split())

if n == 1:
    def solve(v, w):
        return min(v, w)
else:
    def solve(v, w):
        while v != w:
            if v > w:
                v, w = w, v
            w = (w + n - 2) // n
        return v

print('\n'.join(map(str, (solve(*map(int, input().split())) for _ in range(q)))))
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))

is_pairwise_coprime = True
is_setwise_coprime = True
checked = [0]*(N+1)

for i in range(2, N+1):
    if checked[i]:
        continue
    
    tmp = 0
    for j in range(N):
        if A[j]%i == 0:
            tmp += 1
    if tmp > 1:
        is_pairwise_coprime = False
    if tmp == N:
        is_setwise_coprime = False
    
    n = i
    while n < N+1:
        checked[n] = 1
        n += i

if is_pairwise_coprime:
    print('pairwise coprime')
elif is_setwise_coprime:
    print('setwise coprime')
else:
    print('not coprime')

### FIXED CODE ###

from collections import defaultdict

N = int(input())
A = list(map(int, input().split()))

Ones = A.count(1)
R = max(A)
nums = [0]*(R+1)

# 素因数テーブルの作成
D = [0]*(R+1)
for i in range(2, R+1):
    if D[i]:
        continue
    n = i
    while n < R+1:
        if D[n] == 0:
            D[n] = i
        n += i

# 素因子をカウント
for a in A:
    tmp = a
    while tmp > 1:
        prime_factor = D[tmp]
        nums[prime_factor] += 1
        while tmp%prime_factor == 0:
            tmp //= prime_factor
y = max(nums)
if y < 2:
    print('pairwise coprime')
elif y-Ones < N:
    print('setwise coprime')
else:
    print('not coprime')
### BUGGY CODE ###

import numpy as np
import math
import scipy

def hoge():
  dp = [0] * (n + 5)
  for i in range(1, n):
    p = [dp[j] + abs(h_list[i] - h_list[j]) for j in range(max(0, i - k), i)]
    dp[i] = min(p)
  return dp[n - 1]

def solve():
  global n, k, h_list
  n, k = map(int, input().split())
  h_list = list(map(int, input().split()))
  ans = hoge()
  print(ans)
  return 0

if __name__ == "__main__":
  solve()

### FIXED CODE ###

def hoge():
  dp = [0] * (n + 5)
  for i in range(1, n):
    p = [dp[j] + abs(h_list[i] - h_list[j]) for j in range(max(0, i - k), i)]
    dp[i] = min(p)
  return dp[n - 1]

def solve():
  global n, k, h_list
  n, k = map(int, input().split())
  h_list = list(map(int, input().split()))
  ans = hoge()
  print(ans)
  return 0

if __name__ == "__main__":
  solve()
### BUGGY CODE ###


import sys

N, K = [int(v) for v in input().strip().split(' ')]

H = [int(v) for v in sys.stdin.readline().strip().split(' ')]

dp = [int(10 ** 10)] * N

dp[0] = 0
dp[1] = abs(H[0] - H[1])

for i in range(2, N):
    for k in range(1, K + 1):
        if i - k >= 0:
            dp[i] = min(dp[i], dp[i - k] + abs(H[i] - H[i - k]))

print(dp[-1])




### FIXED CODE ###

import sys
import numpy as np

N, K = [int(v) for v in input().strip().split(' ')]

H = np.array([int(v) for v in sys.stdin.readline().strip().split(' ')])

dp = np.zeros(N, dtype=int)

for i in range(1, N):
    st = max(0, i - K)
    dp[i] = min(dp[st : i] + np.abs(H[i] - H[st : i]))

print(dp[-1])
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10000000)

#再帰を使って各ノードのカウンタの値を決定
def dfs(v,p,G,c):
    for u in G[v]:
        if u!=p:
            c[u]+=c[v]
            dfs(u,v,G,c) 

N,Q = list(map(int,input().split()))

G=[]
for i in range(N):
    G.append([])
for i in range(N-1):
    a,b = list(map(int,input().split()))
    a-=1
    b-=1
    G[a].append(b)
    G[b].append(a)

p=[0]*Q
x=[0]*Q
for i in range(Q):
    p[i],x[i] = list(map(int,input().split()))
    p[i]-=1
    
c=[0]*N
for i in range(Q):
    c[p[i]] += x[i]

dfs(0,-1,G,c)

ans = ' '.join([str(x) for x in c])

print(ans)

### FIXED CODE ###

'''
pythonの再帰は10^5timesですら厳しい
import sys
sys.setrecursionlimit(10000000)

def dfs(v,p,G,c):
    for u in G[v]:
        if u!=p:
            c[u]+=c[v]
            dfs(u,v,G,c) 
'''
from collections import deque

N,Q = list(map(int,input().split()))

G=[]
for i in range(N):
    G.append([])
for i in range(N-1):
    a,b = list(map(int,input().split()))
    a-=1
    b-=1
    G[a].append(b)
    G[b].append(a)

p=[0]*Q
x=[0]*Q
c=[0]*N
for i in range(Q):
    p,x = list(map(int,input().split()))
    p-=1
    c[p] += x

stack=deque([0])
parent = [-1]*N

while(stack):
    v = stack.pop()
    for u in G[v]:
        if u!=parent[v]:
            c[u]+=c[v]
            parent[u]=v
            stack.appendleft(u)


ans = ' '.join([str(x) for x in c])

print(ans)
### BUGGY CODE ###

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(200000)

    N,M = map(int,input().split())
    edges = [[]for _ in range(N+1)]
    for _ in range(M):
        a,b = map(int,input().split())
        edges[a].append(b)
        edges[b].append(a)

    colors = [-1]*(N+1)
    def paint(n,p,c):
        ret = 1
        if colors[n]!=-1 and colors[n]!=c:
            ret = 0
        else:
            colors[n] = c
            for nx in edges[n]:
                if nx != p:
                    ret = min(ret,paint(nx,n,(c+1)%2))
        return ret

    def choose(n,k):
        import math
        return math.factorial(n)//(math.factorial(n-k)*math.factorial(k))
    res = paint(1,0,1)
    if res == 0:
        ans = choose(N,2)-M
    else:
        ans = colors.count(0)*(N-colors.count(0))-M

    print(ans)

main()


### FIXED CODE ###

"""
グラフが二部グラフかどうかを判定する。
二部グラフであれば、AグループのノードとBグループのノード同士をそれぞれ結ぶことができる。
二部グラフでない場合、すべてのノード同士を結ぶことができる。
"""
import math
from collections import Counter
import sys
sys.setrecursionlimit(200000)
def choose(n):
    return math.factorial(n)//(math.factorial(n-2)*math.factorial(2))
N,M = map(int,input().split())
edges = [[]for _ in range(N+1)]
for _ in range(M):
    A,B = map(int,input().split())
    edges[A].append(B)
    edges[B].append(A)

colors = [-1]*(N+1)
def f(n,p):
    c = colors[n]
    for v in edges[n]:
        if v != p:
            if colors[v] == -1:
                colors[v] = 1 if c==0 else 0
                f(v,n)
            elif colors[v] == c:
                print(choose(N)-M)
                exit()
colors[1]=0
f(1,0)
count1 = colors.count(0)
count2 = colors.count(1)
print(count1*count2-M)
### BUGGY CODE ###


H, N = map(int, input().split())
Magic = [list(map(int, input().split())) for i in range(N)]
MAX_COST = max(Magic)[1]

# dp[damage] := モンスターに damage を与えるために必要な最小コスト
dp = [float('inf')] * (H + 1)
dp[0] = 0
for h in range(H):
    for damage, cost in Magic:
        next_index = min(h + damage, H)
        dp[next_index] = min(dp[next_index], dp[h] + cost)

print(dp[-1])

### FIXED CODE ###

H, N = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N)]
max_a = max(a for a, b in ab)
dp = [0]*(H+max_a)
for i in range(1, H+max_a):
    dp[i] = min(dp[i-a]+b for a, b in ab)
print(dp[H])
### BUGGY CODE ###

N, K =map(int, input().split())
lst=list(map(int, input().split()))
new_lst=[]
for i in range(0, N-K+1):
	new_lst.append(sum(lst[i:i+K]))
mx=max(new_lst)
print((mx+K)/2)

### FIXED CODE ###

N, K =map(int, input().split())
p=list(map(int, input().split()))

expect=[(dice+1)/2 for dice in p]
#print(expect)
#plus_p=[sum(expect[i:i+K]) for i in range(N-K+1)]

first=sum(expect[0:K])
plus_p=[first]
for i in range(1, N-K+1):
	plus_p.append(plus_p[i-1]-expect[i-1]+expect[i-1+K])
#print(plus_p)
print(max(plus_p))
### BUGGY CODE ###

import math
import itertools
from functools import reduce
from operator import mul
import collections
N = int(input())
l =list(itertools.combinations_with_replacement(range(1,N+1),3))
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
ans=0
for i in l:
    c=collections.Counter(i)
    if len(c)==1:
        ans+=gcd_list(i)
    elif len(c)==2:
        ans+=3*gcd_list(i)
    elif len(c)==3:
        ans+=6*gcd_list(i)
print(ans)

### FIXED CODE ###

import math
import itertools
from functools import reduce
from operator import mul
import collections
N = int(input())
l =list(itertools.combinations_with_replacement(range(1,N+1),3))
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
ans=0
for i in l:
    c=collections.Counter(i)
    if len(c)==1:
        ans+=gcd_list(i)
    elif len(c)==2:
        ans+=3*gcd_list(i)
    elif len(c)==3:
        ans+=6*gcd_list(i)
print(ans)
### BUGGY CODE ###

from collections import Counter

n = int(input())
arr = list(map(int, input().split()))

arr.sort()
c = Counter(arr)

cnt = 0

while cnt < len(arr):
    arr = [arr[cnt]] + [x for x in arr if x % arr[cnt] != 0]
    arr.sort()
    cnt += 1

result = set(arr) - {x for x, y in c.items() if y >= 2}

print(len(result))

### FIXED CODE ###

n = int(input())
arr = list(map(int, input().split()))
arr.sort()

dp = [0] * (10**7)

cnt = 0
for i in range(n):
    if dp[arr[i]] == 0:
        for j in range(1, (10**6 + 10) // arr[i] + 1):
            dp[arr[i] * j] += 1
        if i < n - 1:
            if arr[i] == arr[i + 1]:
                continue
        cnt += 1
    else:
        continue

print(cnt)
### BUGGY CODE ###

s = raw_input()
t = 0
while True:
    N = len(s)
    ok = False
    for i in range(1, N-1):
        if s[i-1] != s[i+1]:
            ok = True
            s = s[:i] + s[i+1:]
            break
    if not ok:
        print "First" if (t % 2 == 1) else "Second"
        break
    t += 1

### FIXED CODE ###

def solve(s):
    return "First" if (len(s) % 2 == 1) ^ (s[0] == s[-1]) else "Second"
s = input()
print(solve(s))
### BUGGY CODE ###

def calc_half(n):
    return int(n /  2)

n, m = map(int, input().split())
a = list(map(int, input().split()))
a_half = list(map(calc_half, a))

for m_num in range(m):
    max_index = a.index(max(a))
    a[max_index] = a_half[max_index]
    a_half[max_index] = calc_half(a_half[max_index])

print(sum(a))


### FIXED CODE ###

import heapq
def calc_Inversion(num):
    return num * -1

n, m = map(int, input().split())
a = list(map(calc_Inversion, list(map(int, input().split()))))

heapq.heapify(a)

for m_num in range(m):
    heapq.heappush(a, int(heapq.heappop(a) / 2))

print(sum(a) * -1)
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
ls = []
for i in range(N):
    ls.append(A.index(i+1)+1)
print(*ls)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
ls = [0]*N
for i in range(N):
    ls[A[i]-1] = i+1
print(*ls)
### BUGGY CODE ###

A2Z="abcdefghijklmnopqrstuvwxyz"

def decode(L1,L2,msg):
    x=[]
    for c in msg:
        if 'a'<=c<='z':
            c = L2[L1.index(c)]
        x.append(c)
    return "".join(x)
        
def affine(msg, key):
    a,b = key
    L = [A2Z[(i*a+b)%26] for i in range(26)]
    L = "".join(L)
    return decode(A2Z,L,msg)

def rot(msg, a):
    if a==0: return msg
    a = a % 26
    L = A2Z[a:]+A2Z[:a]
    return decode(A2Z,L,msg)

def find(msg):
    c0=ord('t')
    i = 3
    while True:
        x = affine(msg,[i,0])
        a = (c0-ord(x[0]))%26
        x = rot(x,a)
        if x in['this','that']: return [i,a]
        i += 2

n = input()
for i in range(n):
    msg = raw_input()
    for w in msg.split():
        if len(w)==4:
            key = find(w)
            if key!=[]: break
    print affine(msg,key)

### FIXED CODE ###

A2Z="abcdefghijklmnopqrstuvwxyz"

def affine(msg, a, b):
    s=""
    for c in msg: s+=(A2Z[(A2Z.index(c)*a+b)%26] if "a"<=c<="z" else c)
    return s

def checkkey(s):
    for i in range(26):
        a = 0
        x = affine(s,i,0)
        c = A2Z.index(x[0])
        if c!=19:
            a = (19-c)%26
            x = affine(x,1,a)
        if x in['this','that']: return i,a
    return -1,-1

n = input()
while n:
    n-=1
    s = raw_input()
    for w in s.split():
        if len(w)==4:
            a,b = checkkey(w)
            if a!=-1: break
    print affine(s,a,b)
### BUGGY CODE ###

from math import sqrt,ceil,gcd
def ii():return int(input())
def si():return input()
def mi():return map(int,input().split())
def li():return list(mi())


# for _ in range(ii()):

n,k=mi()
a=li()
x=[]
ans=1
for i in range(k):
    ans*=a[i]
x=[ans]
for i in range(k,n):
    ans//=a[i-k]
    ans*=a[i]
    x.append(ans)
# print(x)
for i in range(1,len(x)):
    if x[i]>x[i-1]:
        print("Yes")
    else:
        print("No")
    

### FIXED CODE ###

from math import sqrt,ceil,gcd
def ii():return int(input())
def si():return input()
def mi():return map(int,input().split())
def li():return list(mi())


# for _ in range(ii()):

n,k=mi()
a=li()
for i in range(k,n):
    if a[i]>a[i-k]:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

n = int(input())
s = list(input())
l = 0
r = n-1
c = 0
while l < r:
  for i in range(l, r):
    if s[i] == "W":
      l = i
      break
  else:
    l = r
  for i in range(r, l, -1):
    if s[i] == "R":
      r = i
      break
  else:
    r = l
  if l < r:
    c += 1
print(c)
      
    

### FIXED CODE ###

n = int(input())
s = list(input())
l = 0
r = n-1
c = 0
while l < r:
  for i in range(l, r):
    if s[i] == "W":
      c += 1
      l = i+1
      break
  else:
    l = r
  for i in range(r, l-1, -1):
    if s[i] == "R":
      r = i-1
      c += 1
      break
  else:
    r = l

print(c//2)
### BUGGY CODE ###

N, M = list(map(int, input().split()))
ken = [[] for _ in range(N)]

mlist = []
for i in range(M):
    a, b = list(map(int, input().split()))
    ken[a - 1].append(b)
    mlist.append((a, b,))

for v in ken:
    v.sort()

for a, b in mlist:
    print("{:06d}{:06d}".format(a, ken[a - 1].index(b) + 1))


### FIXED CODE ###

N, M = list(map(int, input().split()))
ken = [[] for _ in range(N)]

mlist = []
for i in range(M):
    a, b = list(map(int, input().split()))
    ken[a - 1].append(b)
    mlist.append((a, b,))

for v in ken:
    v.sort()


def search(v, lst):
    l, r = 0, len(lst) - 1
    while l <= r:
        m = (l + r) // 2
        if lst[m] == v:
            return m

        if lst[m] < v:
            l = m + 1
        else:
            r = m - 1
    return None


for a, b in mlist:
    print("{:06d}{:06d}".format(a, search(b,ken[a - 1]) + 1))
### BUGGY CODE ###

N = int(input())
s = [input().split() for i in range(N)]
count = 0

for i in range(N):
    for j in range(i+1, N):
        if sorted(str(s[i])) == sorted(str(s[j])):
            count += 1
print(count)

### FIXED CODE ###

N = int(input())
s = [''.join(sorted(input())) for i in range(N)]
s.sort()
count = 0
num = 1
for i in range(N-1):
    if s[i] == s[i+1]:
        num += 1
    else:
        count += num * (num - 1) // 2
        num = 1
print(count + num * (num - 1) // 2)
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
ans=[]
for i in range(n):
    if (n-1)%2==i%2:
        ans.insert(0,a[i])
    else:
        ans.insert(len(ans),a[i])
print(" ".join(map(str,ans)))


### FIXED CODE ###

from collections import deque
n=int(input())
a=list(map(int,input().split()))
ans=deque([a[0]])
for i in range(1,n):
    if (n-1)%2==i%2:
        ans.appendleft(a[i])
    else:
        ans.append(a[i])
print(" ".join(map(str,ans)))
### BUGGY CODE ###

N, X = map(int, input().split())
S = list(map(int, input().split()))

MOD = 1000000007
numbers = S[:]
numbers.sort()
dp = [[0 for _ in range(X+1)] for _ in range(N+1)]

#for x in range(X+1):
#    dp[0][x] = x
dp[0] = [x for x in range(X+1)]

for i, n  in enumerate(numbers):
    for x in range(X+1):
        dp[i+1][x] += dp[i][x % n]
        #dp[i+1][x] = dp[i+1][x] % MOD
        
        dp[i+1][x] += dp[i][x] * i #% MOD
        #dp[i+1][x] = dp[i+1][x] % MOD

print(dp[N][X] % MOD)

### FIXED CODE ###

N, X = map(int, input().split())
S = list(map(int, input().split()))

MOD = 1000000007
numbers = S[:]
numbers.sort(reverse=True)


dp = {X: 1}

for i, n in enumerate(numbers):
    tmp_dp = {}
    for k, v in dp.items():
        if k < n:
            tmp_dp[k] = (tmp_dp.get(k,0)+v*(N-i))
        else:
            tmp_dp[k]=(tmp_dp.get(k,0)+v*(N-i-1)) 
            tmp_dp[k%n]=(tmp_dp.get(k%n,0)+v) 
    dp = tmp_dp.copy()
        
ans = 0
for k, v in dp.items():
    ans += k *  v

print(ans % MOD)
### BUGGY CODE ###

N, M = map(int, input().split())
ab = []
for _ in range(M):
    a, b = map(int, input().split())
    ab.append((a,b))

# bの昇順でsort
ab.sort(key=lambda inv: inv[1])   


count = 0
while(0 < len(ab)):
    count += 1
    cutb = ab[0][1]
    # cutbで除外できる闘争を除外する
    remove_list = []
    for i in range(len(ab)):
        a, b = ab[i]
        if a <= cutb - 1 and cutb <= b:
            remove_list.append(i)

    for remove_index in reversed(remove_list):
        ab.pop(remove_index)

print(count)


### FIXED CODE ###

N, M = map(int, input().split())
ab = []
for _ in range(M):
    a, b = map(int, input().split())
    ab.append((a,b))

# bの昇順でsort
ab.sort(key=lambda inv: inv[1])   


count = 0
while(0 < len(ab)):
    count += 1
    cutb = ab[0][1]
    # cutbで除外できる闘争を除外する
    remove_index = 0
    for i in range(len(ab)):
        a, b = ab[i]
        if a <= cutb - 1 and cutb <= b:
            remove_index = i
        else:
            break

    ab = ab[remove_index+1:]

print(count)
### BUGGY CODE ###

import sys
input=sys.stdin.readline
n,k,l=map(int,input().split())
#union-find
par1=[-1]*(n+1)
par2=[-1]*(n+1)

def find1(x):
    if par1[x]<0:
        return x
    else:
        par1[x]=find1(par1[x])
        return par1[x]
def find2(x):
    if par2[x]<0:
        return x
    else:
        par2[x]=find2(par2[x])
        return par2[x]
def size1(x):
    return -par1[find1(x)]
def size2(x):
    return -par2[find2(x)]
def unite1(x,y):
    if find1(x)==find1(y):
        return False
    else:
        if size1(x)<size1(y):
            x,y=y,x
        X=find1(x)
        Y=find1(y)
        par1[X]-=size1(Y)
        par1[Y]=X
        return True
def unite2(x,y):
    if find2(x)==find2(y):
        return False
    else:
        if size2(x)<size2(y):
            x,y=y,x
        X=find2(x)
        Y=find2(y)
        par2[X]-=size2(Y)
        par2[Y]=X
        return True
def is_same1(x,y):
    return find1(x)==find1(y)
def is_same2(x,y):
    return find2(x)==find2(y)

for _ in range(k):
    p,q=map(int,input().split())
    unite1(p,q)
for _ in range(l):
    r,s=map(int,input().split())
    unite2(r,s)
ans=[0]*(n)
for i in range(1,n+1):
    for j in range(1,n+1):
        if is_same1(i,j) and is_same2(i,j):
            ans[i-1]+=1
print(*ans, sep=' ')

### FIXED CODE ###

from collections import Counter
n,k,l=map(int,input().split())
#union-find
par1=[-1]*(n+1)
par2=[-1]*(n+1)

def find1(x):
    if par1[x]<0:
        return x
    else:
        par1[x]=find1(par1[x])
        return par1[x]
def find2(x):
    if par2[x]<0:
        return x
    else:
        par2[x]=find2(par2[x])
        return par2[x]
def size1(x):
    return -par1[find1(x)]
def size2(x):
    return -par2[find2(x)]
def unite1(x,y):
    if find1(x)==find1(y):
        return False
    else:
        if size1(x)<size1(y):
            x,y=y,x
        X=find1(x)
        Y=find1(y)
        par1[X]-=size1(Y)
        par1[Y]=X
        return True
def unite2(x,y):
    if find2(x)==find2(y):
        return False
    else:
        if size2(x)<size2(y):
            x,y=y,x
        X=find2(x)
        Y=find2(y)
        par2[X]-=size2(Y)
        par2[Y]=X
        return True
def is_same1(x,y):
    return find1(x)==find1(y)
def is_same2(x,y):
    return find2(x)==find2(y)

for _ in range(k):
    p,q=map(int,input().split())
    unite1(p,q)
for _ in range(l):
    r,s=map(int,input().split())
    unite2(r,s)
L=[]
for i in range(1,n+1):
    L.append((find1(i),find2(i)))
kazu=Counter(L)
ans=[0]*(n)
for i in range(n):
    ans[i]=kazu[L[i]]
print(*ans, sep=' ')
### BUGGY CODE ###

from collections import Counter

N, M=map(int, input().split())
m=[]
ans = 300

for i in range(N):
    m.append(list(map(int,input().split())))


def search(ln):
    #l = []
    cnt = Counter()
    for r in m:
        for col in r:
            if col in ln:
                cnt[col] += 1
                break
    s,c = cnt.most_common(1)[0]
    global ans
    if c < ans:
        ans = c
    ln.remove(s)
    if len(ln) == 0:
        return 
    search(ln)
search(list(range(1, M+1)))
print (ans)

### FIXED CODE ###

from collections import Counter

N, M=map(int, input().split())
m=[]
ans = 300

for i in range(N):
    m.append(list(map(int,input().split())))

def search(ln):
    #l = []
    cnt = Counter()
    for r in m:
        cnt[r[0]] += 1
    s,c = cnt.most_common(1)[0]
    global ans
    ans = min(ans, c)
    ln.remove(s)
    for r in m:
        r.remove(s)
    if len(ln) == 0:
        return 
    search(ln)
search(list(range(1, M+1)))
print (ans)