Harryxun/stf_run huggingface dataset:
h,w = map(int,input().split())
a = [[i for i in input()] for _ in range(h)]
b = [x for in a if "#" in x]
c = zip(*[x for x in zip(*b) if "#"in x])
for d in c:
    print("".join(d))

### FIXED CODE ###

h,w = map(int,input().split())
a = [[i for i in input()] for _ in range(h)]
b = [x for x in a if "#" in x]
c = zip(*[x for x in zip(*b) if "#"in x])
for d in c:
    print("".join(d))
if (A + B) % 2:
    print('IMPOSSIBLE')
else:
    print((A + B) // 2)


### FIXED CODE ###

A, B = [int(_) for _ in input().split()]
if (A + B) % 2:
    print('IMPOSSIBLE')
else:
    print((A + B) // 2)
n, m = map(int, input().split(' '))
a = []
for i in range(m):
    a.append(int(input()))

def t(current, n):
    if current == n:
        return 1
    if current in a:
        return 0
    p1, p2 = 0, 0
    if current + 1 not in a:
        p1 = t(current + 1, n)
    if current + 2 <= n and current + 2 not in a:
        p2 = t(current + 2, n)
    return p1 + p2

result = 1
a.append(n - 1)
for index in range(len(a)):
    if index == 0:
        a1 = 0
    else:
        a1 = a[index - 1] + 1
    a2 = a[index] + 1
    p_step1 = t(a1 + 1,  a2)
    p_step2 = t(a1 + 2,  a2)
    result = (result * (p_step1 + p_step2)) % 1000000007
 
print(result)


### FIXED CODE ###

n, m = map(int, input().split(' '))
a = set()
for i in range(m):
    a.add(int(input()))


s = [0] * (n + 1)
s[0] = 1
for i in range(n):
    j = i + 1
    while(j <= min(n, i + 2)):
        if j not in a:
            s[j] += s[i]
            s[j] = int(s[j] % 1000000007)
        j += 1

print(s[n])
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
ans = 1

for i in range(n):
  d += l[i]
  if d < x:
    ans += 1
  else:
    break
    
print(ans)


### FIXED CODE ###

x, a = map(int, input().split())
if x < a:
  print(0)
else:
  print(10)
X = int(input())
for i in range(130):
  for j in range(-66,66):
    if i**5 - j**5 ==X:
      A = i
      B = j
      break
print(str(A)+str(" ")+str(B))

### FIXED CODE ###

X = int(input())
for i in range(130):
  for j in range(-130,130):
    if i**5 - j**5 ==X:
      A = i
      B = j
      break

print(str(A)+str(" ")+str(B))
import sys
from collections import Counter

N = int(input())
points = []
for i, line in enumerate(sys.stdin):
    x, y = map(int, input().split())
    points.append([x, y])
    if i == N:
        break

counts = []
for i in range(N - 1):
    p = points[i][0] - points[i+1][0]
    q = points[i][1] - points[i+1][1]
    counts.append((p, q))

pq = Counter(counts).most_common()[1]
cost = N - pq
print(cost)

### FIXED CODE ###

import sys
from collections import Counter

N = int(input())
points = []
for i, line in enumerate(sys.stdin):
    x, y = map(int, line.split())
    points.append([x, y])
    if i == N - 1:
        break
if len(points) == 1:
    print(1)
    sys.exit(0)

counts = []
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        p = points[j][0] - points[i][0]
        q = points[j][1] - points[i][1]
        counts.append((p, q))

pq = Counter(counts).most_common()[0][1]
cost = N - pq
print(cost)
N=int(input())
ta=list(input().split())
T=int(ta[0])
A=int(ta[1])
Hi=int(list(input().split()))
print(min(abs(A-t))for i in t=T-Hi[i]*0.006)

### FIXED CODE ###

n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))

d = 1000000000000
ans_count = 1
for i in range(n):
    ans = t - h[i] * 0.006
    if d > abs(a - ans):
        d = abs(a-ans)
        ans_count = i+1
print(ans_count)
x, k, d = map(int, input().split())

x, cnt = abs(x), abs(x) // d
if k % 2 == cnt % 2:
    ans = abs(x - d * min(k, cnt))
elif k % 2 != cnt % 2:
    ans = abs(x - d * min(k, cnt + 1)
print(ans)


### FIXED CODE ###

x, k, d = map(int, input().split())

cnt = abs(x) // d
x = abs(x)
if k % 2 == cnt % 2:
    ans = min(abs(x - d * min(k,cnt)), abs(x + d * min(k,cnt)))
elif k % 2 != cnt % 2:
    ans = min(abs(x - d * min(k,(cnt + 1))), abs(x - d * min(k,(cnt + 1))))
print(ans)
a,b,c=map(int,input().split())
if A==b and b==c:
    print("YES")
else:
    print("NO")
    
    

### FIXED CODE ###

a,b,c=map(int,input().split())
if a-b == b-c:
    print("YES")
else:
    print("NO")
def main() :
    W, H, x, y, r = [int(i) for i in input().split()]

    if ((x-r)>=0) and ((x+r)<=W) and ((y-r)>=0) and ((y+r)<=H) :
       print("Yes")
    else :
       print("No")

if __name__ == '__main__' :
    main()

### FIXED CODE ###

def main() :
    W, H, x, y, r = [int(i) for i in input().split()]

    if ((x-r)>=0) and ((x+r)<=W) and ((y-r)>=0) and ((y+r)<=H) :
        print("Yes")
    else :
        print("No")

if __name__ == '__main__' :
    main()
import heapq

n=int(input())
a=[-int(x) for x in input().split()]

heapq.heapify(a)
ans=heapq.heappop(a)
n-=2

while True:
    temp=heapq.heappop(a)
    ans+=temp
    n-=1
    if n==0:
        break
    ans+=temp
    n-=1
    if n==0:
        break


print(-ans)

### FIXED CODE ###

import heapq

n=int(input())
a=[-int(x) for x in input().split()]

heapq.heapify(a)
ans=heapq.heappop(a)
n-=1

while True:
    n-=1
    if n==0:
        break
    temp=heapq.heappop(a)
    ans+=temp
    n-=1
    if n==0:
        break
    ans+=temp



print(-ans)
import numpy as np
N = int(input())
num = list(map(int, input().split()))

sumz = np.zeros(N+1, dtype=int)
count = np.zeros(N+1, dtype=int)
for i in range(1, N+1):
    sumz[i] = sumz[i-1] + num[i-1]

sortedsumz = np.sort(sumz)

def CC(a, b):
    ans = 1
    mulz = 1
    for i in range(b-a+1, b+1):
        ans *= i
    for i in range(1,a+1):
        mulz *= i
    return int(ans/mulz)

ways = 0
for i in range(1, N+1):
    if sortedsumz[i] == sortedsumz[i-1]:
        count[i] = count[i-1]+1
    elif count[i-1] >= 1:
        ways += CC(2, count[i-1]+1)

    #if sortedsumz[i-1] == 0:
    #    nzero += 1

if count[N] >= 1:
    ways += CC(2, count[N] + 1)
print(ways)


### FIXED CODE ###

import numpy as np
N = int(input())
num = list(map(int, input().split()))

sumz = np.zeros(N+1, dtype=int)
count = np.zeros(N+1, dtype=int)
for i in range(1, N+1):
    sumz[i] = sumz[i-1] + num[i-1]

sortedsumz = np.sort(sumz)

def CC(a, b):
    ans = 1
    mulz = 1
    for i in range(b-a+1, b+1):
        ans *= i
    for i in range(1,a+1):
        mulz *= i
    return int(ans/mulz)

ways = 0
for i in range(1, N+1):
    if sortedsumz[i] == sortedsumz[i-1]:
        count[i] = count[i-1]+1
    elif count[i-1] >= 1:
        ways += CC(2, count[i-1]+1)

    #if sortedsumz[i-1] == 0:
    #    nzero += 1

if count[N] >= 1:
    ways += CC(2, count[N] + 1)
print(ways)
n = int(input())
a = list(map(int,input().split()))

s = sum(a)
p = 0
for i in range(n):
    if i%2 == 1:
        p += a[i]*2

q = s-p
for i in range(n):
    print(q)
    q = a[i]*2-q

### FIXED CODE ###

mod = 2019
l,r = map(int,input().split())

cnt = 0
tank = []
for i in range(l,r+1):
    tank.append(i%mod)
    cnt += 1
    if cnt >= 2020:
        break

res = 2019

n = len(tank)
for i in range(n):
    for j in range(i+1,n):
        res = min(res,tank[i]*tank[j]%mod)
print(res)
N=int(input())
A=list(map(int,input().split()))
A.sort()
ma=A[-1]
dp=[1]*(ma+1)
ans=0

for i in range(len(A)-1):
  p=A[i]
  if dp[i]==1:
    for q in range(ma//p+1):
      dp[p*q]=0
    if A[i]!=A[i+1]:
      ans+=1
if dp[ma]==1:
  ans+=1
print(ans)


### FIXED CODE ###

l=list(map(int,input().split()))
print(l.index(0)+1)
mod = 10**9 + 7  # 998244353 # 変える


def table():
    k = 2 * 10**5 + 5  # 変える
    fac = [1] * k
    finv = [1] * k
    inv = [0] * k
    inv[1] = 1
    for i in range(2, k):
        fac[i] = fac[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        finv[i] = finv[i - 1] * inv[i] % mod
    return fac, finv


fac, finv = table()


def comb(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod


k = int(input())
s = input()
n = len(s) - 1
ans = 1
for i in range(k + 1):
    x = pow(26, k - i, mod) * pow(25, i, mod) % mod
    ans += (comb(n + i, i) * x)
print((ans - 1) % mod)


### FIXED CODE ###

mod = 10**9 + 7  # 998244353 # 変える


def table():
    k = 2 * 10**6 + 5  # 変える
    fac = [1] * k
    finv = [1] * k
    inv = [0] * k
    inv[1] = 1
    for i in range(2, k):
        fac[i] = fac[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        finv[i] = finv[i - 1] * inv[i] % mod
    return fac, finv


fac, finv = table()


def comb(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod


k = int(input())
s = input()
n = len(s) - 1
ans = 1
for i in range(k + 1):
    x = pow(26, k - i, mod) * pow(25, i, mod) % mod
    ans += (comb(n + i, i) * x)
    ans %= mod
print((ans - 1) % mod)
import collections as cl

N=int(input())

L = cl.deque()

for i in range(N):
  S,P_ = input().split()
  P = int(P_)
  
  flg = False
  for j in range(len(L)):
    if L[j][0]>S or (L[j][0]==S and L[j][1]>P):
      L.insert(j,(S,P,i))
      flg = True
  if flg==False:
    L.append(j,(S,P,i))
    
I = [0]*N
for i in range(N):
  I[L[i][2]] = i+1

for i in range(N):
  print(I[i])
      




### FIXED CODE ###

import collections as cl

N=int(input())

L = []

for i in range(N):
  S,P_ = input().split()
  P = int(P_)
  
  flg = False
  for j in range(len(L)):
    if L[j][0]>S or (L[j][0]==S and L[j][1]<P):
      L.insert(j,(S,P,i))
      flg = True
      break
  if flg==False:
    L.append((S,P,i))
        
#I = [0]*N
for i in range(N):
  print(L[i][2]+1)
#  I[L[i][2]] = i+1
N, M = map(int, input().split())
a = set([int(input()) for _ in range(M)])

MOD = 1000000007

dp = [0] * (N + 1)
dp[0] = 1

if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0

for i in range(2, N + 1):
    print(f"i: {i}, dp: {dp}")

    if i in a:
        continue
    dp[i] = dp[i - 1] + dp[i - 2]
    dp[i] %= MOD
print(f"i: {i}, dp: {dp}")

print(dp[N])


### FIXED CODE ###

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

MOD = 1000000007

dp = [0] * (N + 1)
dp[0] = 1

if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0

for i in range(2, N + 1):
    if i in a:
        continue
    dp[i] = dp[i - 1] + dp[i - 2]
    dp[i] %= MOD

print(dp[N])
N = int(input())
S = input()
ans = S.count("R")*S.count("G")*S.count("B")

for i in range(N):
  for j in range(i+1,N):
      k = 2*j-i
      if N>k and S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
          ans-=1
          
print(ans)

### FIXED CODE ###

if "7" in input():
	print("Yes")
else:
	print("No")
# -*- coding: utf-8 -*-
#import numpy as np

def func1(lst, value):
    return [i for i, x in enumerate(lst) if x == value]

n,m = map(int, input().split())
i=0
lst = []
while i < m: 
    l = list(map(int, input().split()))
    l.append(i)
    lst.append(l)
    i+=1
i=1
res=[]
for i in range(1,n+1):
    j=1
    for k in sort(lst):
        if i == k[0]:
            res.append([k[2],str(k[0]).rjust(6,'0') + str(j).rjust(6,'0')])
            j+=1
#ans
for ans in sort(res):
    print(ans[1])


### FIXED CODE ###

# -*- coding: utf-8 -*-
n,m = map(int, input().split())
i=0
lst = []
while i < m: 
    lst.append(list(map(int, input().split())) + [i])
    i+=1
lst = sorted(lst)
j=0
i=1
for k in lst:
    if i != k[0]:
        i=k[0]
        j=1
        k[1]=i*1000000+j
    else:
        j+=1
        k[1]=i*1000000+j

#ans
for ans in sorted(lst, key=lambda x:x[2]):
    print('{0:012d}'.format(ans[1]))
n,m = map(int,input().split())
f = [False for _ in range(n)]
a = [[] for _ in range(n)]
res = 0

def dfs(k):
    global f
    global a
    f[k] = True
    for g in a[k]:
        if not f[g]:
            dfs(g)

for _ in range(m):
    x,y,z = map(int,input().split())
    a[x-1].append(y-1)
    a[y-1].append(x-1)

for i in range(0,n):
    if not f[i]:
        res += 1
        dfs(i)

print(res)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
n,m = map(int,input().split())
f = [False for _ in range(n)]
a = [[] for _ in range(n)]
res = 0

def dfs(k):
    f[k] = True
    for g in a[k]:
        if not f[g]:
            dfs(g)

for _ in range(m):
    x,y,z = map(int,input().split())
    a[x-1].append(y-1)
    a[y-1].append(x-1)

for i in range(n):
    if not f[i]:
        res += 1
        dfs(i)
print(res)
A=int(input()),B=int(put()),C=int(input())
while A<1 or A>100 or B<1 or B>100 or C<1 or C>100:
 A=int(input()),B=int(put()),C=int(input())
D=B//A-C
if D>0:
  print(C)
else:
  print(B//A)

### FIXED CODE ###

A,B,C=map(int,input().split())
D=B//A-C
if D>0:
  print(C)
else:
  print(B//A)
import sys
input = sys.stdin.readline

if __name__ == '__main__':
  n,m,k=map(int,input().strip("\n").split())
  A=list(map(int,input().strip("\n").split()))
  B=list(map(int,input().strip("\n").split()))
  ans=0
  a=0
  b=0
  while k>0 and (a<n or b<m):
    if a>=n:
      if k<B[b]:
        break
      ans+=1
      k-=B[b]
      b+=1
      continue

    if b>=m:
      if k<A[a]:
        break
      ans+=1
      k-=A[A]
      a+=1
      continue

    if A[a]<=B[b]:
      if k<A[a]:
        break
      ans+=1
      k-=A[a]
      a+=1
    else:
      if k<B[b]:
        break
      ans+=1
      k-=B[b]
      b+=1

  print(ans)


### FIXED CODE ###

import sys
from collections import deque
import copy
sys.setrecursionlimit(2147483647)
input = sys.stdin.readline

if __name__ == '__main__':
  n,m,k=map(int,input().strip("\n").split())
  A=list(map(int,input().strip("\n").split()))
  B=list(map(int,input().strip("\n").split()))
  t=sum(B)
  j=m
  ans=0
  for i in range(n+1):
    while j>0 and t>k:
      j-=1
      t-=B[j]
    if t>k:
      break
    ans=max(ans,i+j)
    if i==n:
      break
    t+=A[i]
  print(ans)
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
import math
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)

inf = 10 ** 15
mod = 10 ** 9 + 7
h,w = map(int, input().split())
a = [list(map(int, input().split())) for i in range(h)]
ans = []
for i in range(h):
    if i%2 == 0:
        for j in range(w-1):
            if a[i][j] != 0:
                if a[i][j]%2 == 1:    # 奇数だった
                    ans.append([i,j,i,j+1])
                    a[i][j]-=1
                    a[i][j+1]+=1
        if i < h-1 and a[i][w-1]%2 == 1:
            ans.append([i, j, i+1, j])
            a[i][w-1]-=1
            a[i+1][w-1]+=1
    else:
        for j in range(w-1):
            if a[i][w-1-j]%2 == 1:
                ans.append([i,w-1-j,i,w-1-j-1])
                a[i][w-1-j]-=1
                a[i][w-1-j-1]+=1
        if i < h-1 and a[i][0]%2 == 1:
            ans.append([i,0,i+1,0])
            a[i][0]-=1
            a[i+1][0]+=1
print(len(ans))
for x,y,nx,ny in ans:
    print('{} {} {} {}'.format(x+1,y+1,nx+1,ny+1))

### FIXED CODE ###

inf = 10 ** 15
mod = 10 ** 9 + 7
h,w = map(int, input().split())
a = [list(map(int, input().split())) for i in range(h)]
ans = []
for i in range(h):
    if i%2 == 0:
        for j in range(w-1):
            if a[i][j] != 0:
                if a[i][j]%2 == 1:    # 奇数だった
                    ans.append([i,j,i,j+1])
                    a[i][j]-=1
                    a[i][j+1]+=1
        if i < h-1 and a[i][w-1]%2 == 1:
            ans.append([i, w-1, i+1, w-1])
            a[i][w-1]-=1
            a[i+1][w-1]+=1
    else:
        for j in range(w-1):
            if a[i][w-1-j]%2 == 1:
                ans.append([i,w-1-j,i,w-1-j-1])
                a[i][w-1-j]-=1
                a[i][w-1-j-1]+=1
        if i < h-1 and a[i][0]%2 == 1:
            ans.append([i,0,i+1,0])
            a[i][0]-=1
            a[i+1][0]+=1
print(len(ans))
for x,y,nx,ny in ans:
    print('{} {} {} {}'.format(x+1,y+1,nx+1,ny+1))
a,b=map(int, input().split())
if b < 0:
    if (b-a+1) % 2 == 0:
        ans = 'Positive'
    elif (b-a+1) % 2 == 1:
        ans = 'Negative'
elif a > 0:
 ans='Positive'
else
 ans='Zeros'
  
print(ans)

### FIXED CODE ###

a,b=map(int,input().split())
if b < 0:
    if (b-a+1) % 2 == 0:
        ans = 'Positive'
    elif (b-a+1) % 2 == 1:
        ans = 'Negative'
elif a > 0:
 ans='Positive'
else:
 ans='Zero'
  
print(ans)
n,m=map(int,input().split())
w,l=0,[0]*n
for i in range(m):
    p,s=input().split()
    p,f=int(p)-1,l[p]>=0
    if s=='AC':
        w+=l[p]*f
        l[p]=-1
    else:
        l[p]+=f
print(l.count(-1),w)

### FIXED CODE ###

n,m=map(int,input().split())
a=[]
for i in range(n):
    a.append([0,0])
b=[]
c=0
d=0
for i in range(m):
    b.append(list(input().split()))
    b[i][0]=int(b[i][0])
a=sorted(a,key=lambda x:x[0])
for i in range(m):
    if b[i][1]=='WA':
        if a[b[i][0]-1][0]==0:
            a[b[i][0]-1][1]+=1
    else:
        if a[b[i][0]-1][0]==0:
            a[b[i][0]-1][0]=1
for i in range(n):
    c+=a[i][0]
    if a[i][0]==1:
        d+=a[i][1]
print(c,d)
N = int(input())
A = list[int,input().split()]
B = list[int,input().split()]
i = 0
for c in range(N):
  if A[c]>B[c]:
    i += (A[c]-B[c])
print (i)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
i = 0
for c in range(N):
  if A[c]>B[c]:
    i = i +A[c]-B[c]
print (i)
ST = input().split()
S = list(S)
T = list(T)
for i in S:
  if(S[i]!=T[i]):
    count++
 
print(count)

### FIXED CODE ###

S = input()
s = list(S)
T = input()
t = list(T)
s1=s[0]
t1=t[0]
count = 0
j=0
for i in S:
  if(s[j]!=t[j]):
    count=count+1
  j=j+1
print(count)
a = int(input())
mi=[]
for i in range(1,a-1):
    x=0
    y=0
    j = a - i
    for ii in str(i):
        x+=int(ii)
    for jj in str(j):
        y+=int(jj)
    mi.append(x+y)
print(min(mi))

### FIXED CODE ###

a = int(input())
mi=[]
for i in range(1,a):
    x=0
    y=0
    j = a - i
    for ii in str(i):
        x+=int(ii)
    for jj in str(j):
        y+=int(jj)
    mi.append(x+y)
print(min(mi))
import sys

input = sys.stdin.buffer.readline
in_n = lambda: int(input())
in_nn = lambda: map(int, input().split())
in_s = lambda: input().rstrip().decode('utf-8')
in_map = lambda: [s == ord('.') for s in input() if s != ord('\n')]

MOD = 10**9 + 7
INF = 8 * 10**18


def main():

    X, A, B = in_nn()
    print((X - A) % B)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

input = sys.stdin.buffer.readline
in_n = lambda: int(input())
in_nn = lambda: map(int, input().split())
in_s = lambda: input().rstrip().decode('utf-8')
in_map = lambda: [s == ord('.') for s in input() if s != ord('\n')]

MOD = 10**9 + 7
INF = 8 * 10**18


def main():

    X = in_n()
    A = in_n()
    B = in_n()
    print((X - A) % B)


if __name__ == '__main__':
    main()
s = set(map(int, input().split()))
print(s.count())

### FIXED CODE ###

s = set(map(int, input().split()))
print(len(s))
N = int(input())
for i in range(N+1):
    if N < i**2:
        j = i - 1
        break
print(j**2)

### FIXED CODE ###

N = int(input())
for i in range(N+1):
    if N < i**2:
        j = i - 1
        break
if N == 1:
    print(1)
else:
    print(j**2)
a,b,x=map(int,input().split())
if a**2*b>2*x:
  ans=math.degree(math.atan(2*x/(a*b**2)))
  print(ans)
else:
  ans=math.degree(math.atan(a**2/(2*a*b-x/a)))
  print(ans)
  

### FIXED CODE ###

import math
a,b,x=map(int,input().split())
A,B=a**2,b**2
print(math.degrees(math.asin((B/((2*x/(a*b))**2+B))**0.5) if 2*x<=a*a*b else math.acos((A/((2*(a*a*b-x)/A)**2+A))**0.5)))
n = int(input())
num = list(map(int,input().split()))
num.reverse()
for i in range(n-1):
    print(num[i],end = " ")
print(num[n-1])

### FIXED CODE ###

n =int(input())
a = list(map(int,input().split()))
a.reverse()
for i in range(n):
    if i!=n-1:
        print(a[i],end=" ")
    else:
        print(a[i])
n,m=map(int,input().split())

if n==3:
    mod=100
elif n==2:
    mod=10
else:
    mod=1

a=[]
for i in range(m):
    a.append(list(map(int,input().split())))


for i in range(m-1):
    for j in range(i+1,m):
        if a[i][0]==a[j][0]:
            if a[i][1]!=a[j][1]:
                print(-1)
                exit()

a.sort()
a1=10
a2=10
a3=10
for i in range(m):
    if a[i][0]==1:
        a1=min(a1,a[i][1])
    if a[i][0]==2:
        a2=min(a2,a[i][1])
    if a[i][0]==3:
        a3=min(a3,a[i][1])
ans=0
if a1!=10:
    ans+=a1*100
if a2!=10:
    ans+=a2*10
if a3!=10:
    ans+=a3


if ans==0:
    print(-1)
else:
    if n==2:
        ans=list(ans)
        for i in range(2):
            print(ans[i],end="")
    elif n==1:
        ans=list(ans)
        print(ans[0])
    else:
        print(ans)


### FIXED CODE ###

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


a=[]
for i in range(m):
    a.append(list(map(int,input().split())))


if m==0:
    if n==1:
        print(0)
    elif n==2:
        print(10)
    else:
        print(100)
    exit()

for i in range(m-1):
    for j in range(i+1,m):
        if a[i][0]==a[j][0]:
            if a[i][1]!=a[j][1]:
                print(-1)
                exit()

a.sort()
a1=10
a2=10
a3=10
if n==3:
    for i in range(m):
        if a[i][0]==1:
            a1=a[i][1]
        if a[i][0]==2:
            a2=a[i][1]
        if a[i][0]==3:
            a3=a[i][1]
    if a1==0:
        print(-1)
        exit()
    if a1==10:
        a1=1
    if a2==10:
        a2=0
    if a3==10:
        a3=0
    if (a1%10)*100+(a2%10)*10+(a3%10)==0:
        print(-1)
    else:
        print((a1%10)*100+(a2%10)*10+(a3%10))

elif n==2:
    for i in range(m):
        if a[i][0]==1:
            a1=a[i][1]
        if a[i][0]==2:
            a2=a[i][1]
    if a1==0:
        print(-1)
        exit()
    if a1==10:
        a1=1
    if a2==10:
        a2=0

    if (a1%10)*10+(a2%10)==0:
        print(-1)
    else:
        print((a1%10)*10+(a2%10)*1)

else:
    for i in range(m):
        if a[i][0]==1:
            a1=a[i][1]
    
    print(a1%10)
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D[0]=0
for i in range(1,N+1):
  D.append((D[i-1]+L[i-1]))
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)

### FIXED CODE ###

N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[]
D.append(0)
for i in range(1,N+1):
  D.append(D[i-1]+L[i-1])
s=0
for j in range(0,N+1):
  if D[j]<=X:
    s+=1
print(s)
print(1100-int((input()))

### FIXED CODE ###

print(1110-int(input()))
import sys,heapq
input=sys.stdin.readline
N,M=[int(x) for x in input().strip().split()]
AB=[list(map(int,input().strip().split())) for _ in range(N)]
AB.sort()
n=0
sumB=0
q=[]
for m in range(1,M+1):
    maxB=0
    while n<N and AB[n][0]<=m:
        heapq.heappush(q,-AB[n][1])
        n+=1
    sumB+=heapq.heappop(q)
    if len(q)==0: break
    
print(-sumB)

### FIXED CODE ###

import sys,heapq
input=sys.stdin.readline
N,M=[int(x) for x in input().strip().split()]
AB=[list(map(int,input().strip().split())) for _ in range(N)]
AB.sort()
n=0
sumB=0
q=[]
for m in range(1,M+1):
    while n<N and AB[n][0]<=m:
        heapq.heappush(q,-AB[n][1])
        n+=1
    if len(q)!=0:
        sumB+=heapq.heappop(q)

print(-sumB)
ans = {"SUN":7, "MON":6, "TUE":5, "WED":4, "THU":3, "FRI":2, "SAT":1, }
s = input()
print(ans[s])D

### FIXED CODE ###

ans = {"SUN":7, "MON":6, "TUE":5, "WED":4, "THU":3, "FRI":2, "SAT":1, }
s = input()
print(ans[s])
k,x=map(int,input().split())
start,end=max(-100_0000,x-(k-1)),min(100_0000,x+(k-1))
r=range(start,end+1)
print(*r,sep=' ')

### FIXED CODE ###

n,k=map(int,input().split())
ra=range(max(-1000000,k-(n-1)),min(1000000+1,k+(n-1)+1))
li=[i for i in ra]
print(*li,sep=' ')
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    S = input()
    S = sorted(S)
    if S = ['a','b','c']:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    S = input()
    S = sorted(S)
    if S == ['a','b','c']:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()