Problem:


Score : 100 points

Problem Statement

On some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in yyyy/mm/dd format. For example, January 23, 2018 should be written as 2018/01/23.

After finishing the document, she noticed that she had mistakenly wrote 2017 at the beginning of the date column. Write a program that, when the string that Takaki wrote in the date column, S, is given as input, modifies the first four characters in S to 2018 and prints it.

Constraints

S is a string of length 10.

The first eight characters in S are 2017/01/.

The last two characters in S are digits and represent an integer between 1 and 31 (inclusive).

Input

Input is given from Standard Input in the following format:

S

Output

Replace the first four characters in S with 2018 and print it.

Sample Input 1

2017/01/07

Sample Output 1

2018/01/07

Sample Input 2

2017/01/31

Sample Output 2

2018/01/31



Sample input:
2017/01/07


Sample output:
2018/01/07

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
for i in range(N+1):
  for j in range(N+1-i):
    if 10000*i + 5000*j + 1000*(N-i-j) == Y:
      print(i, j, N-i-j)
    else: 
      print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
for i in range(N+1):
  for j in range(N+1-i):
    if Y == 10000*i + 5000*j + 1000*(N-i-j):
      print(i, j, N-i-j)
    else: 
      print("-1, -1, -1")

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
for i in (N+1):
  for j in (N+1-i):
    if Y == 10000*i + 5000*j + 1000*(N-i-j):
      print(i, j, N-i-j)
    else: 
      print("-1, -1, -1")

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
for i in (N+1):
  for j in (N+1-i):
    if Y == 10000*i + 5000*j + 1000*k:
      print(i, j, N-i-j)
    else: 
      print("-1, -1, -1")

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
for i in (N+1):
  for j in (N+1-i):
    if Y == 10000*i + 5000*j + 1000*k 
      print(i, j, N-i-j)
    else: 
      print("-1, -1, -1")

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
for i in (N+1):
  for j in (N+1-i):
    if Y == 10000*i + 5000*j + 1000*k 
      print(i, j, N-i-j)
    else: 
      print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
for i in (N+1):
  for j in (N+1-i):
    k = N-i-j
    if Y == 10000*i + 5000*j + 1000*k 
      print(i, j, k)
    else: 
      print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
n, y = map(int, input().split())

def main():
    flg = True
    if (5000*n) == y:
        print('{} {} {}'.format(0, n, 0))
        return
    if (10000*n) == y:
        print('{} {} {}'.format(n, 0, 0))
        return
    for i in range(n):
        for j in range(n-i):
            for k in range(n-(j+i)):
                if (10000*i + 5000*j + 1000*k) == y:
                    print('{} {} {}'.format(i, j, k))
                    flg = False
                    break
            if not flg:
                break
        if not flg:
            break
    if flg:
        print('-1 -1 -1')

main()

Submission status: Runtime Error

Solution code:
n, y = map(int, input().split())

def main():
    flg = True
    if (5000*n) == y:
        print('{} {} {}'.format(0, n, 0))
        return
    if (10000*n) == y:
        print('{} {} {}'.format(n, 0, 0))
        return
    for i in range(n):
        for j in range(n-i):
            for k in range(n-(j+i)):
                if (10000*i + 5000*j + 1000*k) == y:
                    print('{} {} {}'.format(i, j, k))
                    flg = False
                    break
            if not flg:
                break
        if not flg:
            break
    if flg:
        print('-1 -1 -1')

main()

Submission status: Runtime Error

Solution code:
S=input()
print(S.replace(S[3],'8')

Submission status: Runtime Error

Solution code:
S=input()
print(S.replace([3],'8')

Submission status: Runtime Error

Solution code:
date = str(input())
date[3]="8"
print(date)

Submission status: Runtime Error

Solution code:
S=input()
S[3]=8
print(S)

Submission status: Runtime Error

Solution code:
ss=input()
ss[3]=8
print(ss)

Submission status: Runtime Error

Solution code:
n,y = map(int,input().split())
lst = []
ans = 0
for i in range(y//10000+1):
    for j in range(y//5000+1):
        k = n-i-j
        if k >= 0:
            lst.append([i,j,k])
            ans += 1
if ans > 0:
    print(*lst[0])
else:
    print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
n,y = map(int,input().split())
if n*1000>y:
    print("-1 -1 -1")
else:
    x=n*1000
    n10 = 0
    n5 = 0
    while y-x>=9000:
        x = x+9000
        n10 = n10+1
        if n<n10:
            print("-1 -1 -1")
            break

    while y-x>=4000:
        x = x+4000
        n5 = n5+1
        if n10+n5>n:
            print("-1 -1 -1")
            break

    if y==x:
        l=[n10,n5,n-n5-n10]
        print(*l)
    else:
        print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
print(len(set(input() for i in range(int(input())))))

Submission status: Runtime Error

Solution code:
N = int(input())

#複数段の整数を配列に入力
d=[int(input()) for i in range(N)]
count = N

#sort
d.sort()

for n in range(N):
    if d[n-1] == d[n]:
        count -=1

#output
print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
 
hoge = [0 for i in range(0,n)]
for i in range(0,n):
    hoge[i] = int(input())
    
 
number_set = set(hoge)
print(len(number_set))

Submission status: Runtime Error

Solution code:
s = input()
s[3] = '8'

print(s)

Submission status: Runtime Error

Solution code:
#85A already2018
s=input()
s=s[:2]+"7"s[4:]
print(s)

Submission status: Runtime Error

Solution code:
n, y = map(int, input().split())

YH = -1
IH = -1
HN = -1

for a in range(n):
    for b in range(n-a):
         c = n-a-b
         total = 10000*a + 5000*b + 1000*c
         if total == y:
            YH = a
            IH = b
            HN = c

print(YH, IH, HN)

Submission status: Runtime Error

Solution code:
nums = [int(input()) for _ in range(int(input()))]
nums_dict = dict()
for i in nums:
    nums_dict[i] = True
print(len(nums_dict.keys()))

Submission status: Runtime Error

Solution code:
#already2018
s=input()
s[3]=7
print()

Submission status: Runtime Error

Solution code:
def resolve():
    N, Y = map(int, input().split())

    resx, resy, resz = (-1, -1, -1)
    n = min(N, Y//10000)
    for x in range(n+1):
        for y in range(n+1-x):
            z = N - x - y
            total = 10000*x + 5000*y + 1000*z

            if total == Y:
                resx, resy, resz = (x, y, z)
                break
    
    print(resx, resy, resz)
    
resolve()

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
count = 0
select = []
for i in range(a+1):
  for j in range(a+1 - i):
    s = 10000*i + 5000*j + 1000*(a-i-j)
    if s == b:
        select.append(i)
        select.append(j)
        select.append(a-i-j)
        count += 1
        break
  else:
    continue
  break
if count == 0:
  print(-1,-1,-1)
else:
  print(select[0],select[1],select[2])

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
count = 0
select = []
for i in range(a+1):
  for j in range(a+1):
      c = a - (i+j)
      if (10000*i + 5000*j + 1000*c) == b:
        select.append(i)
        select.append(j)
        select.append(a-i-j)
        count += 1
  else:
    continue
  break
if count == 0:
  print(-1,-1,-1)
else:
  print(select[0],select[1],select[2])

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
count = 0
select = []
for i in range(a+1):
  for j in range(a+1):
      c = a - (i+j)
      if 10000*i + 5000*j + 1000*(a -i- j) == b:
        select.append(i)
        select.append(j)
        select.append(a-i-j)
  else:
    continue
  break
if count == 0:
  print(-1,-1,-1)
else:
  print(select[0],select[1],select[2])

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
count = 0
for i in range(a+1):
  for j in range(a+1):
      c = a - (i+j)
      s = (10000*i + 5000*j + 1000*c)
      if b == s:
        count+=1
        break
  else:
    continue
  break
if count == 0:
  print(-1,-1,-1)
else:
  print(i,j,c)

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
count = 0
for i in range(a+1):
  for j in range(a+1):
      c = a - (i+j)
      s = (10000*i + 5000*j + 1000*c)
      if b == s:
        count+=1
        print(i,j,c)
        break
  else:
    continue
  break
if count == 0:
  print(-1,-1,-1)
else:
  pass

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
b = b/10000
m = 1
five = 0.5
t = 0.1
count = 0
for i in range(a+1):
  for j in range(a+1):
      c = a - (i+j)
      s = (m*i + five*j + t*c)
      if b == s:
        count+=1
        print(i,j,c)
        break
  else:
    continue
  break
if count == 0:
  print(-1,-1,-1)

Submission status: Runtime Error

Solution code:
s_17 = input()
# print(s_17)
s_17[3] = 8
print(*s_17)

Submission status: Runtime Error

Solution code:
print("input().replace("2017", "2018")")

Submission status: Runtime Error

Solution code:
from bisect import bisect_left
def main():
  n,h=map(int,input().split())
  a=[None]*n
  b=a[:]
  ans=0
  for i in range(n):
    a[i],b[i]=map(int,input().split())
  m=max(a)
  b=sorted(b,reverse=True)
  x=bisect_left(b,m)
  for i in b[:n]:
    h-=i
    ans+=1
    if h<=0:
      print(ans)
      return
  ans+=(h+m-1)//m
  print(ans)
main()

Submission status: Runtime Error

Solution code:
S=input()
S[3]=8
print(S)

Submission status: Runtime Error

Solution code:
def main():
    n, y = map(int, input().split())
    ans = '-1 -1 -1'
    if (10000*n < y):
        print(ans)
        return
    for i in range(n+1):
        for j in range(n-i+1):
            k = n-i-j
            if (1000*i+5000*j+10000*k==y):
                ans = '{0} {1} {2}'.format(k,j,i)
                break
        else:
            continue
        break
    print(ans)
main()

Submission status: Runtime Error

Solution code:
s= input()
print(s.replace('2017','2018')

Submission status: Runtime Error

Solution code:
s = input()
m = s.replace(2017,2018)
print(m)

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
 
for x in range(N+1):
  for y in range(N+1-x):
        if x*10000 + y*5000 + (N-x-y)*1000 == Y:
           print(x, y, N+1-x-y)
           exit()
 
print(-1,-1,-1)

Submission status: Runtime Error

Solution code:
N_,Y_=input().split()
N=(int)(N_)
Y=(int)(Y_)

count = 0
a_ = Y//10000
if a_>N:
    a_ = N
for a in range(a_+1):
    Y_ = Y-a*10000
    N_ = N-a
    b_ = Y_//5000
    if b_>N_ and b_>=0:
        b_ = N_
    for b in range(b_+1):
        Y_ = Y_-b*5000
        N_ = N_-b
        c_ = Y_//1000
        if c_==N_ and c_>=0:
            print((str)(a)+" "+(str)(b)+" "+(str)(c_))
            exit(0)
print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
s=input()
s[3]=str(8)
print(s)

Submission status: Runtime Error

Solution code:
s=input()
s[3]="8"
print(s)

Submission status: Runtime Error

Solution code:
n, y = map(int, input().split())

for i in range(n):
    for j in range(n):
        for k in range(n):
            a = i * 10000
            b = j * 5000
            c = k * 1000
            num = i + j + k
            price = a + b + c
            if num == 9 and price == y:
                print(i, j, k)
                exit()
print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
S = list(input())
print(S[:3]+"8"+S[4:])

Submission status: Runtime Error

Solution code:
S = input()
S[3]="8"
print(S)

Submission status: Runtime Error

Solution code:
S = input()
S[3]=str("8")
print(S)

Submission status: Runtime Error

Solution code:
a,sums= list(map(int,input().split()))
print(a)
yuki = sums//10000
taishi = (sums%10000) //5000
noguchi = (sums%5000) //1000
while a<yuki+taishi+noguchi:
  if a-(yuki+taishi+noguchi)%4==0:
    taishi-=1
    noguchi+=5
  else:
    yuki-=1
    taishi+=2
print(yuki,taishi,noguchi)

Submission status: Runtime Error

Solution code:
str = input()
str[3] = '8'
print(str)

Submission status: Runtime Error

Solution code:
ymd = input() 
S = input()  

y,m,d = ymd.split()  
y = int(y)  
m = int(m)
d = int(d)

def Already(y,m,d):
  if [S] = 2018:
    return 2017

Submission status: Runtime Error

Solution code:
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
		char[] a = sc.next().toCharArray();
		a[3]='8';
		System.out.print(a);
		
    }
}

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

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

ans_x, ans_y, ans_z = -1, -1, -1

#n_list = np.append([0], range(N+1))
#n_list = np.append(n_list, [N])

#print(n_list)
#print(len(n_list))
#print(range(len(n_list)))
#print(range(10 ,len(n_list)))

for i in range(N+1) :
  x = i
  #sum = 10000*x
  #if sum > Y :
  #  continue

  for j in range(N+1) :
    y = j
    z = N - x - y
    sum = 10000*x + 5000*y + 1000*z
    #print("tameshi : " + str(x) + " " + str(y) + " " + str(z))
    if sum == Y and x>=0 and y>=0 and z>=0 :
      print(str(x) + " " + str(y) + " " + str(z))
      sys.exit(0)

print(str(ans_x) + " " + str(ans_y) + " " + str(ans_z))

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

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

ans_x, ans_y, ans_z = -1, -1, -1

n_list = np.append([0], range(N+1))
n_list = np.append(n_list, [N])

#print(n_list)
#print(len(n_list))
#print(range(len(n_list)))
#print(range(10 ,len(n_list)))

for i in range(len(n_list)) :
  x = n_list[i]
  sum = 10000*x
  if sum > Y :
    continue

  for j in range(i+1 ,len(n_list)) :
    y = n_list[j] - x
    z = N - x - y
    sum = 10000*x + 5000*y + 1000*z
    #print("tameshi : " + str(x) + " " + str(y) + " " + str(z))
    if sum == Y and x>=0 and y>=0 and z>=0 :
      print(str(x) + " " + str(y) + " " + str(z))
      sys.exit(0)

print(str(ans_x) + " " + str(ans_y) + " " + str(ans_z))

Submission status: Runtime Error

Solution code:
s = input()
s[0:3] = "2018"

print(s)

Submission status: Runtime Error

Solution code:
n, y = map(int, input().split())

noguchi = 1000
higuchi = 5000
yukichi = 10000

ans = '-1 -1 -1'
for i in range(n+1):
    for j in range(n+1-i):
        k = n - (i+j)
        yen = noguchi * i + higuchi * j + yukichi * k
        if yen == y:
            ans = '{0} {1} {2}'.format(k,j,i)
            break

print(ans)

Submission status: Runtime Error

Solution code:
S = input()

L = S.split("/")

L[0] = "2018"

print(L[0]+"/"L[1]+"/"L[2])

Submission status: Runtime Error

Solution code:
S = input()

L = S.split(/)

L[0] = "2018"

print(L[0]+L[1]+L[2])

Submission status: Runtime Error

Solution code:
S = input()
s[3] = '8'
print(s)

Submission status: Runtime Error

Solution code:
number,money=input().rstrip().split()
number=int(number)
money=int(money)
bill=[0,0,0]

for i in range(number+1):
    bill=[0,0,0]
    mass=money-10000*i
    bill[0]=i
    if mass==0 and sum(bill)==number:
        break
    elif mass<0:
        break
    else:
        for j in range(number+1):
            if j!=0:
                mass=mass-5000
            bill[1]=j
            if mass==0 and sum(bill)==number:
                break
            elif mass<0:
                break
            else:
                k=int(mass/1000)
                bill[2]=k
                if sum(bill)==number:
                    break
    if sum(bill)==number:
        mass=0
        break
                
if mass==0:
    print(str(bill[0])+' '+str(bill[1])+' '+str(bill[2]))
else:
    print(str(-1)+' '+str(-1)+' '+str(-1))

Submission status: Runtime Error

Solution code:
i = list(map(int, input().split()))

a = i[1]%i[0]

x = i[1] // 10000
y = i[1]%10000 // 5000
z = ((i[1]%10000)%5000) //1000

if a == 0 and (x+y+z) <= i[0]:
    print(x,',',y,',',z)

elif (x+y+z) > i[0]:
    print('-1 -1 -1')

elif a != 1:
    print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
N, H = map(int, input().split())
a = [0] * N
b = [0] * N
for i in range(N):
    a[i], b[i] = map(int, input().split())

A = int(max(a))
B = [i for i in b if i > A]

B.sort(reverse=True)

Sum = 0

for i in range(len(B)):
    H -= B[i]
    Sum += 1
    if H <= 0:
        break

if H > 0:
    Sum += int((H-1)//A)+1


print(Sum)

Submission status: Runtime Error

Solution code:
n,h=map(int,input().split())
a=[0]*n
b=[0]*n
for i in range(n):
   a[i],b[i]=map(int,input().split()) 
x=max((a))
y=[i for i in b if i>x]
y.sort(reverse=True)
count=0
for i in range(len(y)):
    if h>0:
        count+=1
        h-=y[i]
    else:
        break

if h>0:
     count +=int(h//x)+1
print(count)

Submission status: Runtime Error

Solution code:
s=[map(str,input().split())]
s[3]=str(int(s[3])+1)
print("".join(s))

Submission status: Runtime Error

Solution code:
s = list(input())
if s[3] == '7':
  ans = s[:3] + '8' + s[4:]
else:
  ans = s
print(ans)

Submission status: Runtime Error

Solution code:
s = list(input())
if s[3] == '7':
  s = s[:3] + '8' + s[4:]
print(s)

Submission status: Runtime Error

Solution code:
s = input()
if s[3] == '7':
  s[3] = '8'
print(s)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
S = input().strip()
S[3] = "8"
print(S)

Submission status: Runtime Error

Solution code:
s = input()
if s[:4] != "2018":
    s[:4] = "2018"
print(s)

Submission status: Runtime Error

Solution code:
N,Y = (int(x) for x in input().split())

ans = [-1,-1,-1]
for a in range(N+1):
    for b in range(N+1-a):
        c=N-a-b
        if Y==10000*a+5000*b+1000*c:
            ans = [a,b,c]
            exit()

print(*ans)

Submission status: Runtime Error

Solution code:
s = input()

s[3] = '7'

print(s)

Submission status: Runtime Error

Solution code:
N,Y = (int(x) for x in input().split())

ans = [-1,-1,-1]
for a in range(N+1):
    for b in range(N+1-a):
        if a+b<=N:
            c=N-a-b
            if Y==10000*a+5000*b+1000*c:
                ans = [a,b,c]
                break

print(*ans)

Submission status: Runtime Error

Solution code:
N,Y = (int(x) for x in input().split())

ans = [-1,-1,-1]
for a in range(N+1):
    for b in range(N+1-a):
        c=N-a-b
        if Y==10000*a+5000*b+1000*c:
            ans = [a,b,c]
            break

print(*ans)

Submission status: Runtime Error

Solution code:
N,Y = (int(x) for x in input().split())

for a in range(N+1):
    for b in range(N+1):
        c=N-a-b
        if Y==10000*a+5000*b+1000*c:
            ans = [a,b,c]
            break
        else:
            ans = [-1,-1,-1]

print(*ans)

Submission status: Runtime Error

Solution code:
import sys

N, Y = list(map(int , input().split()))
for x in range(N+1):
    for y in range(N+1):
        z = N - x-  y
        if z >=0:
            if 10000*x+5000*y+1000*z ==Y:
                print('{} {} {}'.format(x,y,z))
                sys.exit()
print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
N,Y=map(int,input().split())
a=-1
b=-1
c=-1
for i in range(0,N+1):
    for j in range(0,N-i+1):
        if 10000*i+5000*j+1000*(N-i-j) == Y:
                a=i
                b=j
                c=N-i-j
print(a,b,c)

Submission status: Runtime Error

Solution code:
s = input()
t = '2018'

for i in range(len(s))
  if i > 3:
    print(s[i],sep='',end='')
  else:
    print(t[i],sep='',end='')

Submission status: Runtime Error

Solution code:
s = input()
t = '2018'

for i in range(len(s))
  if i > 4:
    print(s[i],sep='',end='')
  else:
    print(t[i],sep='',end='')

Submission status: Runtime Error

Solution code:
n=int(input())
print(len(set([input() for _ in range(n)])))

Submission status: Runtime Error

Solution code:
n = int(input())

d = []
for i in range(n):
    d.append(int(input()))

d_2 = sorted(d, reverse=True)
ans = 1
for i in range(1, n):
    if d_2[i] < d_2[i-1]:
        ans += 1
    else:
        continue

print(ans)

Submission status: Runtime Error

Solution code:
print(input().replace("2017","2018))

Submission status: Runtime Error

Solution code:
s = str(input())
print('2018/01' + s[-2] + a[-1])

Submission status: Runtime Error

Solution code:
s = input()
print('2018/01' + s[-2] + a[-1])

Submission status: Runtime Error

Solution code:
a, b, c = map(int, input().split(/))

if a == 2017:
    print('{}/{}/{}'.format(2018, b, c))

Submission status: Runtime Error

Solution code:
import sys
N,Y=map(int,input().split())
count=0
for x in range(N+1):
  for y in range(N+1):
    z=N-x-y
    total=10000*x+5000*y+1000*z
    if total == Y:
      print(x,y,z)
      sys.exit()    
print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
n,y=map(int,input().split())
anslist=[]
for i in range(n+1):
    for j in range(n-i+1):
        if i*10000+j*5000+(n-i-j)*1000 == y :
            list=[i,j,n-i-j]
            anslist.append(list)
if len(anslist)>0:
    print("{} {} {}".format(anslist[0][0],anslist[0][1],anslist[0][2],))
else:
    print("{} {} {}".format(-1,-1,-1))

Submission status: Runtime Error

Solution code:
n,y=map(int,input().split())
anslist=[]
for i in range(n+1):
    for j in range(n-i+1):
            if i*10000+j*5000+(n-i-j)*1000 == y :
                list=[i,j,n-i-j]
                anslist.append(list)
if len(anslist)>0:
    print("{} {} {}".format(anslist[0][0],anslist[0][1],anslist[0][2],))
else:
    print("{} {} {}".format(-1,-1,-1))

Submission status: Runtime Error

Solution code:
n,y=map(int,input().split())
anslist=[]
for i in range(n+1):
    for j in range(n-i+1):
            if i*10000+j*5000+(n-i-j)*1000 == y :
                list=[i,j,k]
                anslist.append(list)
if len(anslist)>0:
    print("{} {} {}".format(anslist[0][0],anslist[0][1],anslist[0][2],))
else:
    print("{} {} {}".format(-1,-1,-1))

Submission status: Runtime Error

Solution code:
s=input()
s[2].replace("8")
print(s)

Submission status: Runtime Error

Solution code:
s = input()
print(s.replace("2017,"2018"))

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]
print(len(list(set(a))))

Submission status: Runtime Error

Solution code:
n, h = map(int, input().split())
A, B = [], []
for _ in range(n):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)


throw_a = max(A)
B = sorted(B, reverse=True)
count = 0

while h > 0:
    count += 1
    if throw_a > max(B):
        h -= a
    else:
        h -= max(B)
        B.remove(max(B))

print(count)

Submission status: Runtime Error

Solution code:
bun = input()
str_bun = list(bun)
str_bun[0,1,2,3,] = "2","0","1","8"
str_changed = "".join(str_bun)
print(str_bun)

Submission status: Runtime Error

Solution code:
S = input()

print(S.replace(2017, 2018))

Submission status: Runtime Error

Solution code:
from dateutil.relativedelta import relativedelta
import datetime
S = str(input())
date_format = datetime.datetime.strptime(S,'%Y/%m/%d')
date_format = date_format+ relativedelta(years=1)
print(date_format.strftime("%Y/%m/%d"))

Submission status: Runtime Error

Solution code:
S = input()
S[:4] = "2018"
print(S)

Submission status: Runtime Error

Solution code:
s = input()
s[4:5]='8'
print(s)

Submission status: Runtime Error

Solution code:
s=input()
print("2018"+s[4:]

Submission status: Runtime Error

Solution code:
import sys

N, Y = list(map(int, input().split()))
for i_yukichi in range(N + 1):
    for j_higuchi in range(N + 1 - i_yukichi):
        k_noguchi = N - i_yukichi - j_higuchi
        if 10000 * i_yukichi + 5000 * j_higuchi + 1000 * k_noguchi == Y:
            print(i_yukichi, j_higuchi, k_noguchi)
            sys.exit()

print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
import sys

N, Y = list(map(int, input().split()))
for i_yukichi in range(N + 1):
    for j_higuchi in range(N + 1 - i_yukichi):
        k_noguchi = N - i_yukichi - j_higuchi
        if 10000 * i_yukichi + 5000 * j_higuchi + 1000 * k_noguchi == Y:
            print(i_yukichi, j_higuchi, k_noguchi)
            sys.exit

print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
n,p = map(int,input().split())
res10000 = res5000 = res1000 = -1
x = y = 0
end = False
for x in range(n):
    if end:
        break
    for y in range(n):
        if x*10000+y*5000+ (n-(x+y))*1000 == p:
            print(x,y)
            res10000 = x
            res5000 = y
            res1000 = n-(x+y)
            end = True
print('{} {} {}'.format(res10000,res5000,res1000))

Submission status: Runtime Error

Solution code:
S = input()

S2 = S.replace(7,8,1)

print(S2)

Submission status: Runtime Error

Solution code:
S=input()
S[3]='7'
print(S)

Submission status: Runtime Error

Solution code:
n, y = map(int, input().split())
z = y/1000
for i in range(1,n+1):
    for j in range(0, n+1-i):
        k = n - i- j
        if 10*i + 5*j + k == z:
            print('i, j, k')
            exit(0)
print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
date = input()
date[3] = "8"
print(date)

Submission status: Runtime Error

Solution code:
a=input()
a[3]=8
print(a)

Submission status: Runtime Error

Solution code:
N,Y=map(int,input().split())
for x in range(N+1):
    for y in range(N-x+1):
        z=N-x-y
        if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y:
            print(x,y,z)
            exit()
print(-1,-1,-1)

Submission status: Runtime Error

Solution code:
print(input()[0:3]+'8'+input()[4:])

Submission status: Runtime Error

Solution code:
print(input()[0:3]+'8'+input()[5:])

Submission status: Runtime Error

Solution code:
n = input()
n[4] = '8'
print(n)

Submission status: Runtime Error

Solution code:
n = input()
n[4] = 8
print(n)

Submission status: Runtime Error

Solution code:
n = input()
n[0:4] = '2018'
print(n)

Submission status: Runtime Error

Solution code:
s=str(input())
print(s.replace("2017"."2018"))

Submission status: Runtime Error

Solution code:
s=str(input())
print(s.reprace("2017"."2018"))

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())

o_a = -1
o_b = -1
o_c = -1

for a in range(N+1):
    for b in range(N+1):
        c = N - a - b

        if c < 0:
            continue

        total = 10000 * a + 5000 * b + 1000 * c
        if a + b + c == N & total == N:
            o_a = a
            o_b = b
            o_c = c

print("{} {} {}".format(o_a, o_b, o_c))

Submission status: Runtime Error

Solution code:
def pay(i: int, remain: int, z: int):
    for i in range(0, (n - z) + 1):
        if 10 * i + 5 * (remain - i) + z == m:
            print(i, remain - i, z)
            exit()

    return


n, M = list(map(int, input().split(" ")))
m = int(M / 1000)

for z in range(n, -1, -1):
    pay(0, n - z, z)

print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
S =str(input())
print('2018/01/' + s[-2:])

Submission status: Runtime Error

Solution code:
y,m,d=input().split('/')

y=int(y)
y+=1
y=str(y)\
print(y+'/'+m+'/'+d)

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
for i in range(N + 1):
  for j in range(N - i + 1):
    if 10000*i + 5000*j + 1000*(N - i - j) == Y:
      print(i, j, N - i - j)
      exit()
print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
S = input()
S[:3] = '2018'
print(S)

Submission status: Runtime Error

Solution code:
n,y=map(int,input().split())
for a in range(n+1):
    for b in range(n+1):
        c=n-a-b
        if c<0:
            continue 
        if a*10000+b*5000+c*1000==y:
            print(a,b,c)
            exit()
print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
n,y = map(int, input().split())
for a in range(n+1):
    for b in range(n+1):
        c=n-a-b
        if 10000*a + 5000*b + 1000*c == y:
            print(a, b, c)
            exit
print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
n,h = map(int,input().split())
A = []
B = []
for i in range(n):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)
A.sort(reverse=True)
B.sort(reverse=True)
B = [ i for i in B if i > A[0] ]
ans = 0
for i in B:
    ans += 1
    h -= i
    if h < 0:
        break
if h > 0:
    if h % A[0] == 0:
        ans += h // A[0]
    else:
        ans += h // A[0] + 1
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
S[0:4]="2018"
print(S)

Submission status: Runtime Error

Solution code:
print(replace(input(),'7','8',1))

Submission status: Runtime Error

Solution code:
n = int(input())

d = [int(input()) for i in range(n)]

deduplicate = set(d)

print(len(deduplicate))

Submission status: Runtime Error

Solution code:
import sys

def solve(N: int, Y: int):
    max_i = N//10000
    for i in range(0,max_i+1): ##10000円
        for j in range(N-i+1):
            k = N-i-j
            if 10000*i+5000*j+1000*k == Y:
                print(i,j,k)
                return 

    print(-1,-1,-1)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    Y = int(next(tokens))  # type: int
    solve(N, Y)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-i+1):
    if 10000*i+5000*j+1000*(n-i-j)==y:
        print(i,j,n-i-j);exit()
print(-1,-1,-1)

Submission status: Runtime Error

Solution code:
s = ['2017', '/', '01', '/', '07']
print(s.pop[2017])
print(s.append[2018])

Submission status: Runtime Error

Solution code:
N = int(input())
a = sorted(map(int, [input() for i in range(N)]), reverse=True)

dan = 1

for i in range(N-1):
	if a[i] > a[i+1]:
		dan += 1

print(dan)

Submission status: Runtime Error

Solution code:
day = list(map(int,input().split('/')))
day[0] = 2018
print(day[0],day[1],day[2],sep('/'))

Submission status: Runtime Error

Solution code:
day = list(input().split('/'))
day[0] = '2018'
print(day[0],day[1],day[2],sep(/))

Submission status: Runtime Error

Solution code:
day = list(input().split('/'))
day[0] = 2018
print(day[0],day[1],day[2],sep(/))

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())

for y in range(0, 2001):
    for z in range(2001-y, - 1, -1):
        if 10000 * N - 5000 * y - 9000 * z - Y == 0:
            print(N - y - z, y, z)
            break
        elif y == 2000 and z == 0:
            print(-1, -1, -1)
            break
        else:
            pass
    if 10000 * N - 5000 * y - 9000 * z - Y == 0:
        break
    elif y == 2000 and z == 0:
        break
    else:
        pass

Submission status: Runtime Error

Solution code:
# https://atcoder.jp/contests/abc085/tasks/abc085_b
n = int(input())
print(len(set(map(int, [input() for i in range(n)]))))

Submission status: Runtime Error

Solution code:
N,Y = map(int,input().split())
flag = 0

#10000円のループ
for x in range(N+1):
    if Y-x*10000 < 0:
        print(-1,-1,-1)
        break
    #5000円のループ
    for y in range(N+1-x):
        z = N-x-y
        if (Y-x*10000-y*5000 < 0) or (Y-x*10000-y*5000-z*1000 != 0):
            break
        else:
            print(x,y,z)
            flag = 1
    if flag == 1:
        break

Submission status: Runtime Error

Solution code:
print(input()[:3]+"8"+input()[5:])

Submission status: Runtime Error

Solution code:
n = int(input())
print(len(set(map(int, [input() for i in range(n)]))))

Submission status: Runtime Error

Solution code:
print(len(set(int(input()) for _ in range(int(input())))))

Submission status: Runtime Error

Solution code:
date = input()

print(date.replace(date[4:],2018))