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:
S=input()

S[3]="8"
print(S)

Submission status: Runtime Error

Solution code:
S = str(input())
S = S.replace(2017, 2018, 1)
print(S)

Submission status: Runtime Error

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

Y/=1000

s=0

for i in range(N+1):
    for j in range(N+1-i):
        if Y-i*10-j*5<=N-i-j and Y-i*10-j*5>=0:
            s=1
            print('{} {} {}'.format(i,j,Y-i*10-j*5))
            break

if s==0:
    print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
s = input().split("/")
print("2018/01/"+s[3])

Submission status: Runtime Error

Solution code:
import sys

a = []
for line in sys.stdin:
    a.append(int(line))
    
print(len(set(a))-1)

Submission status: Runtime Error

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

for i in range(N+1):
    for j in range(N-i+1):
        if 10*i + 5*j + N-i-j == Y:
            print("{} {} {}".format(i, j, N-i-j))
            exit()

print("-1 -1 -1")

Submission status: Runtime Error

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

isTrue = False
for i in range(N+1):
    for j in range(N-i+1):
        for k in range(N-i-j+1):
            if 10*i + 5*j + k == Y:
                isTrue = True
                print("{} {} {}".format(i, j, k))
                break
        else:
            continue
        break
    else:
        continue
    break

if not isTrue:
    print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
n, y = map(int, input().split())
y = y/1000
answer= ""

for rep1 in range(n + 1):
    for rep2 in range(n + 1):
        for rep3 in range(n + 1):
            if rep1 + rep2 + rep3 == n and rep1 * 10 + rep2 * 5 + rep3 == y:
                answer = ("rep1 rep2 rep3")
                break

print(answer) if answer != "" else print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
n, y = map(int, input().split())
y = y/1000
counter = []

for rep1 in range(n + 1):
    for rep2 in range(n + 1):
        for rep3 in range(n + 1):
            if rep1 + rep2 + rep3 == n and rep1 * 10 + rep2 * 5 + rep3 == y:
                counter = ([rep1, rep2, rep3])
                break

print(counter) if counter != [] else print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
money  = [1000,5000,10000]
n,k = list(map(int,input().split()))

def calc_num(n,y):
    for i in range(n+1):
        for j in range((n+1)-i):
            if money[0]*i + money[1]*j + money[2]*(n-(i+j)) == y and i+j+(n-(i+j)) == n:
                return[n-(i+j),j,i]
    return[-1,-1,-1]

o = calc_num(n,k)
print(o[0],o[1],o[2])

Submission status: Runtime Error

Solution code:
money  = [1000,5000,10000]
n,k = list(map(int,input().split()))

def calc_num(n,y):
    for i in range(n+1):
        for j in range((n+1)-i):
            for k in range((n+1)-(i+j)):
                if money[0]*i + money[1]*j + money[2]*k == y and i+j+k == n:
                    return[i,j,k]
    return[-1,-1,-1]

print(calc_num(n,k)[::-1])

Submission status: Runtime Error

Solution code:
S = input()

S[0:4] = '2018'
print(S)

Submission status: Runtime Error

Solution code:
li = input().split()
N = int(li[0])
Y = int(li[1])
p = "-1 -1 -1"

for i in range(2001):
  for j in range(2001):
    if 10000 * i + 5000 * j + 1000 * (N - i - j) == Y:
      p = "{} {} {}".format(i, j, N- i - j)

print(p)

Submission status: Runtime Error

Solution code:
S = input()
Snew = "2018"
for i in range(4):
    S[i] = Snew[i] 
    
print(S)

Submission status: Runtime Error

Solution code:

S = input()
S[0:3]="2018"
print(S)

Submission status: Runtime Error

Solution code:

S = input()
S[0:3]="2017"
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())
total = 0
for i in range(n+1):
	for j in range(n+1-i):
		k = n - i - j
		total = i*10000 + j*5000 + k*1000
		if total == y:
			print(i,j,k)
			break
		total = 0
	else:
		continue
	break
else:
	print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
from numba import jit
N, Y = map(int, input().split())

count_max = Y / 1000  # all 1000

@jit
def sample(n, y):
    ans = '-1 -1 -1'
    for i in reversed(range(y // 10000 + 1)):
        count_tmp1 = count_max - 9 * i
        price_tmp1 = y - 10000 * i
        if count_tmp1 < n or price_tmp1 < 0:
            continue

        if count_tmp1 == n:
            ans = '{} {} {}'.format(i, 0, N - i)
            return ans

        if price_tmp1 > 5000 * count_tmp1:
            return ans

        for j in reversed(range(price_tmp1 // 5000 + 1)):
            count_tmp2 = count_tmp1 - 4 * j
            price_tmp2 = price_tmp1 - 5000 * j
            if count_tmp2 < n or price_tmp2 < 0:
                continue
            if count_tmp2 == n:
                ans = '{} {} {}'.format(i, j, N - i -j)
                return ans
            if price_tmp2 > 5000 * count_tmp2:
                return ans
    return ans
a = sample(N, Y)
print(a)

Submission status: Runtime Error

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

ans = '-1 -1 -1'
count_max = Y / 1000  # all 1000

if (Y % 10000 == 0) and (Y // 10000 == N):
    print('{} 0 0'.format(Y//10000))
    exit()


for i in reversed(range(Y // 10000)):
    count_tmp1 = count_max - 9 * i
    price_tmp1 = Y - 10000 * i
    if count_tmp1 < N or price_tmp1 < 0:
        continue

    if count_tmp1 == N:
        ans = '{} {} {}'.format(i, 0, N - i)
        #ans_list.append(ans)
        break

    if (price_tmp1 % 5000 == 0) and ((price_tmp1 // 5000 + count_tmp1) == N):
        ans = '{} {} {}'.format(i, price_tmp1 // 5000, 0)
        break

    is_continue = True
    for j in reversed(range(price_tmp1 // 5000)):
        count_tmp2 = count_tmp1 - 4 * j
        price_tmp2 = price_tmp1 - 5000 * j
        if count_tmp2 < N or price_tmp2 < 0:
            continue
        if count_tmp2 == N:
            ans = '{} {} {}'.format(i, j, N - i -j)
            is_continue = False
            break
    if not is_continue:
        break
print(ans)

Submission status: Runtime Error

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

ans = '-1 -1 -1'
count_max = Y / 1000  # all 1000

if Y % 10000 == 0:
    print('{} 0 0'.format(Y//10000))
    exit()


for i in reversed(range(Y // 10000)):
    count_tmp1 = count_max - 9 * i
    price_tmp1 = Y - 10000 * i
    if count_tmp1 < N or price_tmp1 < 0:
        continue

    if count_tmp1 == N:
        ans = '{} {} {}'.format(i, 0, N - i)
        #ans_list.append(ans)
        break

    if price_tmp1 % 5000 == 0:
        ans = '{} {} {}'.format(i, price_tmp1 // 5000, 0)
        break

    is_continue = True
    for j in reversed(range(price_tmp1 // 5000)):
        count_tmp2 = count_tmp1 - 4 * j
        price_tmp2 = price_tmp1 - 5000 * j
        if count_tmp2 < N or price_tmp2 < 0:
            continue
        if count_tmp2 == N:
            ans = '{} {} {}'.format(i, j, N - i -j)
            is_continue = False
            break
    if not is_continue:
        break
print(ans)

Submission status: Runtime Error

Solution code:
#input
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)
#manipulation
count = 0
a = max(A)
B.sort(reverse=True)
for b in B:
    if (b > a) & (h > 0):
        h -= b
        count += 1
count += (h + a - 1) // a
#output
print(count)

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):
    k = N - i - j
    if Y == 10000 * i + 5000 * j + 1000 * k:
        print(" ".join(map(str, [i, j, k])))
        quit(0)
print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
n = int(input())
li = []
for i in range(n):
    num = int(input())
    if num not in li:
        li.append(num)
print(len(li))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
[N,Y] = list(map(int,input().split()))
x = [0,0,0]
x[0] = Y//10000
x[1] = (Y - (10000*x[0]))//5000
x[2] = (Y - (10000*x[0]) - (5000*x[1]))//1000
ans = [-1,-1,-1]
for i in range(x[0]+1):
    for j in range(x[1]+(2*i)+1):
        N_temp = (x[0]-i) + (x[1]+2*i-j) + (x[2]+5*j)
        if N_temp == N:
            ans = [(x[0]-i) , ((x[1]+2*i-j)) , (x[2]+5*j)]
print('{0[0]} {0[1]} {0[2]}'.format(ans))

Submission status: Runtime Error

Solution code:
s = str(input())
t = s.replace("2017","2018")
pirnt(t)

Submission status: Runtime Error

Solution code:
s = str(input())
s[:5] = '2018'
print(s)

Submission status: Runtime Error

Solution code:
s=input()
ss=s.replace(7,8,1)
print(ss)

Submission status: Runtime Error

Solution code:
S = input()
S[0] = '2'
S[1] = '0'
S[2] = '1'
S[3] = '8'
print(for i in S)

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
# i: man, j: gosen, k: sen
output_flag=0
for i in range(0, N+1):
    while output_flag==0:
        for j in range(0, N+1-i):
            k = N-i-j
            if 10000*i+5000*j+1000*k==Y:
                print(i, j, k)
                output_flag=1
                break
    if output_flag==1:
        break
if output_flag==0:
    print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
y,m,d=list(input().split())
y=2018
print(y+"/"+m+"/"+d)

Submission status: Runtime Error

Solution code:
y,m,d=input().split()
y=2018
print(y+"/"+m+"/"+d)

Submission status: Runtime Error

Solution code:
N,Y = map(int,input().split())
 
a = -1
b = -1
c = -1
for i in range(int(N+1)):
  for j in range(int(N+1-i)):
    k = int(N - i - j)
    total = int(10000*i + 5000*j + 1000*k)
    if (total == Y) and int(i + j + k) == N:
      a = i
      b = j
      c = k
      break
print("{} {} {}".format(a,b,c))

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())
 
#10000:a, 5000:b, 1000:c
for a in range(N+1):
    for b in range(N+1-a):
        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, Y = map(int, input().split())
 
#10000:a, 5000:b, 1000:c
for a in range(N+1):
    for b in range(N+1-a):
        c = N - a - b
        if 10000 * a + 5000 * b + 1000 * c == Y:
            print(a, b, c)
            break
print(-1, -1, -1)
N, Y = map(int, input().split())
 
#10000:a, 5000:b, 1000:c
for a in range(N+1):
    for b in range(N+1-a):
        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, Y = map(int, input().split())
 
#10000:a, 5000:b, 1000:c
for a in range(N+1):
    for b in range(N+1-a):
        c = N - a - b
        if 10000 * a + 5000 * b + 1000 * c == Y:
            print(a, b, c)
            break
print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
n,h=map(int,input().split())
a=[list(map(int,input().split()))for i in range(n)]
b=max(a,key=lambda x:x[0])[0]
c=sorted(t for(s,t)in a if t>b)[::-1]
d=0
for i in c:
    h-=i
    d+=1
    if h<0:
        print(d)
        exit()
if h>0:
    d+=max(h-1,-1)//b+1
print(d)

Submission status: Runtime Error

Solution code:
N = int(input())
d = []
for i in range(N):
    d.append(int(input()))
print(len(set(d)))

Submission status: Runtime Error

Solution code:
def main():
	N,Y = map(int, input().split())
	Y /= 1000
	candidates = list()
	sen = 0; gosen = 0; itiman = 0
	sen += amari_sen(Y); Y_amari = Y - amari
	if (Y_amari % 10 == 5):
		first_sen = sen; first_gosen = gosen+1; first_itiman = itiman
		second_sen = sen+5; second_gosen = gosen; second_itiman = itiman
		Y_amari -= 5
	man = Y_amari / 10
	for i in range(man): # i=itimanの数
		sentogosen = man - i
		for j in range(sentogosen): # j=gosenの数
			k = sentogosen - 5 * j # k=senの数
			candidate.append([first_sen+k,first_gosen+j,first_itiman+i])
			candidate.append([second_sen+k,second_gosen+j,second_itiman+i])
	flag = 0
	for i in range(len(candidate)):
		N_cand = candidate[i][0] + candidate[i][1] + candidate[i][2]
		if(N_cand == N):
			print(str(candidate[i][2]) + " " + str(candidate[i][1]) + " " + str(candidate[i][0]))
			flag = 1
			break
	if(flag == 0):
		print("-1 -1 -1")
      
def amari_sen(Y):
	amari = Y % 5
	return amari
	  
if __name__ == "__main__":
	main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
argv = input().split()
n = int(argv[0])
y = int(argv[1])

a = y // 10000
b = (y % 10000) // 5000
c = (y % 5000) // 1000

ta = a
tb = b
tc = c

if ta + tb + tc == n:
    print(ta, tb, tc)
    exit(0)


while ta >= 0:
    while tb >= 0:
        if ta + tb + tc == n:
            print(ta, tb, tc)
            exit(0)
        tb -= 1
        tc += 5
    ta -= 1
    tb = b + (a-ta)*2
    tc = c
print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
n, y = list(map(int, input().split(' ')))
for ten_th in range(min(n, int(y / 10000)), -1, -1):
    if y < ten_th * 10000 or n < ten_th:
        continue
    for five_th in range(min(n - ten_th, int((y - ten_th * 10000) / 5000)), -1, -1):
        if y < ten_th * 10000 + five_th * 5000 or n < ten_th + five_th:
            continue
        if (y - ten_th * 10000 - five_th * 5000) % 1000 == 0:
            th = int((y - ten_th * 10000 - five_th * 5000) / 1000)
            if n == ten_th + five_th + th:
                print('{} {} {}'.format(ten_th, five_th, th))
                exit()
print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
a = int(input().split("/"))
a[0]=2018
print(str(a[0])+"/"+str(a[1])+"/"+str(a[2]))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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())
ans = []
for i in range(n+1):
    for j in range(n+1-i):
        k = n-i-j
        if 10000*i + 5000*j + 1000*k == y and k >=0:
            ans.append([i,j,k])
            break
                
if len(ans) >=1:
    str_ans = map(str, ans[0])
    print(' '.join(str_ans))
if len(ans) == 0:
    print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
s=list(input())
s[3]=8
print(''.join(s))

Submission status: Runtime Error

Solution code:
N, Y = map(int,input().split())
t = Y//1000
counter = 0
if counter==0:
    for i in range(t//10+1):
        if counter==0:   
            for j in range(t//5+1):
                if counter==0:
                    for k in range(t+1):
                        if (10000*i+5000*j+1000*k)==Y and (i+j+k)==N and counter == 0:
                            counter+=1
                            print(i, j, k)
                            break
if counter == 0:
    print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
#バケット法による解
N = int(input())
dlist = []
for i in range(N):
    dlist.append(int(input()))
dbacket = [0]*100
for d in dlist:
    dbacket[d] += 1
answer = 0
for db in dbacket:
    if db > 0:
        answer += 1
print(answer)

Submission status: Runtime Error

Solution code:
s = input().rstrip()

s1 = "2018" + s[4:] if s.startwith("2017") else s

Submission status: Runtime Error

Solution code:
a,b = input().split()
cnt = 0

for i in range(10):
  for j in range(10-i):
    k = 9-i-j
    s = 10000*i + 5000*j + 1000*k
    if int(b) == s:
      if int(a) == i+j+k:
        print("{} {} {}".format(i,j,k))
        cnt = 1
  else:
    continue
  break

if cnt != 1:
  print("{} {} {}".format(-1,-1,-1))

Submission status: Runtime Error

Solution code:
N = input()

a = []
for i in range(int(N)):
  a.append(input())

cnt = []
while(len(a) != 0):
  cnt.append(a.count(a[0])-1)
  a.remove(a[0])
su = sum(cnt)
print(int(N)-su)

Submission status: Runtime Error

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

flag = False

for i in range(N + 1) :
    for j in range(N + 1 - i) :
        k = N - i - j
        if 10000 * i + 5000 * j + 1000 * k == Y :
            print(i, j, k)
            flag = True
            break
    if flag == True :
        break

if flag == False :
    print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
import copy
n,hp=map(int,input().split(" "))
la=[0 for i in range(n)]
lb=[0 for i in range(n)]
for i in range(n):
    la[i],lb[i]=map(int,input().split(" "))
cnt=0
ma=max(la)
lma=[i for i ,x in enumerate(la)  if x==ma]
mib=10**9
for i in lma:
    if lb[i]<mib:
        mib=lb[i]
        k=i
tmp=copy.deepcopy(lb)
while max(tmp)>ma:
    hp-=max(tmp)
    tmp.remove(max(tmp))
    cnt+=1
    if hp<0:
        print(cnt)
        exit(0)
if lb[k]>ma:
    hp+=lb[k]
if lb[k]>ma:
    hp-=lb[k]
    cnt+=1
if hp%ma==0:
    print(cnt+int(hp/ma))
else:
    print(cnt+int(hp/ma)+1)

Submission status: Runtime Error

Solution code:
n,m=list(map(int,input().split(" ")))
x,y,z=0,0,0
j=0
for z in range(n+1):
    for y in range(n+1):
        for x in range(n+1):
            if x+y+z>n:
                break
            if x+y+z==n:
                if x*1000+y*5000+z*10000==m:
                    print(z,y,x)
                    j=1
                    break
        if x*1000+y*5000+z*10000==m:
            break
    if x*1000+y*5000+z*10000==m:
        break
if j==0:
    print(-1,-1,-1)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
for s in range(b//10000+1):
    try:
        for t in range(b//5000+1):
            r=b-s-t
            if 10000*s+5000*t+1000*r==b and s+t+r==a:
                print(s,t,r)
                exit()
    except ZeroDivisionError:
        continue
print(-1,-1,-1)

Submission status: Runtime Error

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

for i in range(x+1):
    for j in range(x-i+1):
            if (i*10000 + j*5000 + (x-i-j+1)*1000) == y:
                print(i,j,(x-i-j+1))
                exit()
print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
import numpy as np

n = int(input())
a = np.array(list(map(int, [input() for i in range(n)])))

print(len(np.unique(a)))

Submission status: Runtime Error

Solution code:
import numpy as np

n = input()
a = np.array(list(map(int, input().split())))

print(len(np.unique(a)))

Submission status: Runtime Error

Solution code:
S = input()
print(S.replace("018"), ("017"))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
rx, ry, rz = -1, -1, -1

for x in range(N+1):
    for y in range(N+1-x):
        for z in range(N+1-x-y):
            if 1000*x + 5000*y + 1000*z == Y:
                rx, ry, rz = x, y, z
                break
    
print(rx, ry, rz)

Submission status: Runtime Error

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

N = int(input())
mochi_set = [input() for _ in range(N)]
print(len(set( mochi_set )))

Submission status: Runtime Error

Solution code:
s = list(input())
s[3] = 8
print(''.join(s))

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
max_10000 = Y // 10000
max_5000 = (Y % 10000) // 5000
max_1000 = (Y % 5000) // 1000
mininum = max_1000 + max_5000 + max_10000
maximum = Y // 1000
n_10000 = -1
n_5000 = -1
n_1000 = -1
if (mininum) <= N and (maximum) >= N:
    diff = maximum - N
    for i in range(diff // 9, -1, -1):
        if (diff - i*9)%4 == 0:
            n_10000 = i
            n_5000 = (diff - i*9)//4
            n_1000 = N - n_10000 - n_5000
            break
print(n_10000, n_5000, n_1000)

Submission status: Runtime Error

Solution code:
tuple=input()
list=tuple.split()
list=[int(i) for i in list]
N=list[0]
Y=list[1]
for i in range(int(Y/10000)+1):
    for j in range(int((Y-10000*i)/5000)+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:
date = input()
print("2018"  + data[4:])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
count,total = list(map(int,input().split()))
NF = True
ret1 = -1
ret2 = -1
ret3 = -1
if total <= count * 10000:
	for i in range(count + 1):
		rCount = count - i
		if total-10000*i <= rCount * 5000:
			for j in range(rCount + 1):
				if (i*10000 + j*5000 + (count-i-j)*1000) == total:
					NF = False
					ret1 = i
					ret2 = j
					ret3 = count-i-j
				break
print(str(ret1) + " " + str(ret2) + " " + str(ret3))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input()
s = ""
for i in range(a):
    if i == 3:s+="8"
    else:s+=a[i]
print(s)

Submission status: Runtime Error

Solution code:
a = input()
s = ""
for i in range(a):
    if i == 3:s+=8
    else:s+=i
print(s)

Submission status: Runtime Error

Solution code:
import numpy as np
n, y = np.array(list(input().split()), dtype=int)

vals = np.array([10000, 5000, 1000])

def get_tuple(n, y):
    for c in range(n + 1):
        for b in range(n + 1 - c):
            a = n - c - b
            nums = np.array([a, b, c])
            yield nums

for nums in get_tuple(n, y):
    if (nums * vals).sum() == y:
        print("{} {} {}".format(*nums))
        break
else:
    print("-1 -1 -1")

Submission status: Runtime Error

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


#総当たりで合計金額を算出
x = []
y = []
z = []

for num_ten_thousand in range(0, N+1):
    for num_five_thousand in range(0, N+1):
            
            #千円の枚数を算出
            num_one_thousand = N-(num_ten_thousand+num_five_thousand)
            
            #合計金額を算出
            total = num_ten_thousand*10000 + num_five_thousand*5000 + num_one_thousand*1000
            
            #（合計金額がYと等しいか・合計枚数がNと等しいか）を確認し答えをリストに格納
            if Y==total and N==num_ten_thousand+num_five_thousand+num_one_thousand:
                x.append(num_ten_thousand)
                y.append(num_five_thousand)
                z.append(num_one_thousand)
                
                
#答えを出力
if not x:
    print(-1, -1, -1, sep=" ")
    
else:
    print(x[0], y[0], z[0], sep=" ")

Submission status: Runtime Error

Solution code:
N = int(input())
D = [int(input()) for _ in range(N)]

ans = len(set(D))

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include<iostream>
using namespace std;
int main() {
  string s;
  cin >> s;
  s[3] = '8';
  cout << s << endl;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=list(input())
s[3]=8
S="".join(s)
print(S)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, H = map(int, input().split(' '))
a = []
b = []
for i in range(N):
    temp_a, temp_b = input().split(' ')
    a.append(int(temp_a))
    b.append(int(temp_b))
maxa = max(a)
c = [i for i in b if i > maxa]
sorted_b = sorted(b)[::-1]
i = 0
while(H > 0 and i != N):
    if maxa < sorted_b[i]:
        H -= sorted_b[i]
        i += 1
    else:
        break
left = 0
if H > 0:
    left = (H + maxa - 1) // maxa
print(i + left)

Submission status: Runtime Error

Solution code:
def main(n, y):
    for i in range(0, n):
        for j in range(0, n - i):
            if (i * 10000 + j * 5000 + (n-i-j) * 1000) == y:
                return '{} {} {}'.format(i, j, (n - i - j))
    return '-1 -1 -1'


if __name__ == '__main__':
    n, y = map(int, input().split())
    print(main(n, y))

Submission status: Runtime Error

Solution code:
a = list(input())
a[3] = '8'
print("".join.(a))

Submission status: Runtime Error

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

S[3] += 1

print(S)

Submission status: Runtime Error

Solution code:
N=int(input())
List=[int(input()) for i in range(N)]
List.sort(key=lambda x:x)
n=1
So=[]
while n<=List[N-1]:
  if n in List:
    So.append(n)
  n+=1
print(len(So))

Submission status: Runtime Error

Solution code:
#include<cstdio>
#include<iostream>
using namespace std;

int main(){
    char s[13];
    cin >> s;
    s[3]='8';
    printf("%s\n",s);
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = raw_input()
MISSED_IDX = 3
S[MISSED_IDX] = 8

print S

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!

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:
# coding: utf-8
# Your code here!

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:
n,y=map(int,input().split())
for i in range(n):
    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:
n,y=map(int,input().split())
#print(n,y)
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)
            exit()
print(-1,-1,-1)

Submission status: Runtime Error

Solution code:
n,y=map(int,input().split())
#print(n,y)
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)
            exit()
        else:
            print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
n,y=map(int,input().split())
#print(n,y)
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)
            exit()
        else:
            print(-1,-1,-1)

Submission status: Runtime Error

Solution code:
date=input()
#if date[0:4]=="2017":
date="2018"+[4:]
print(date)

Submission status: Runtime Error

Solution code:
#-*- coding:utf-8 -*-
import sys
N, Cost = map(int, input().split())

a_out, b_out = -1, -1

for i in range(N+1):
  for j in range(N-i+1):
    if 10000*i + 5000*j + 1000*(N-i-j) == Cost:
        print(i, j, N-i-j)
        sys.exit()

print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
S = input().split("/")
S[0] = "2018"
print(S.join("/"))

Submission status: Runtime Error

Solution code:
#AtCorder Beginner Contest 085  C Otoshidama
n, y = map(int, input().split())

a = -1
b = -1
c = -1

for i in range(n + 1):
    if 10000*i == y and i == n:
        a = i
        b = 0
        c = 0
        break
    else:
        for j in range(n-i + 1):
            if i+j == n and 10000*i + 5000*j == y:
                a = i
                b = j
                c = 0
                break
            else:
                for k in range(n - i - j + 1):
                    if y > 1000*n:
                        break
                    elif  i + j + k == n and 10000*i + 5000*j + 1000*k == y :
                        a = i
                        b = j
                        c = k
                        break


print(str(a) + " " + str(b) + " " + str(c))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
a, b, c = -1, -1, -1

if Y >= 2000 * 10000:
    ZN = 1
    YN = 1
    XN = 2000
else:
    ZN = min(N, Y//1000)
    YN = min(N, Y//5000)
    XN = min(N, Y//10000)
    
for z in range(ZN + 1):
    for y in range(YN + 1):
        for x in range(XN + 1):
            if x + y + z == N and 1000*z + 5000*y + 10000*x == Y:
                a, b, c = x, y, z
                break

print(a, b, c)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;

int main(){
	int M;
	cin>>M;
	cout<<48-M<<endl;
}

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
n = int(raw_input())
l = []
for i in range(n):
  l.append(int(raw_input()))
#print(l)

flag = [0] *100
#print(flag)
for j in l:
  if flag[j] == 0:
    flag[j] = 1
#print(flag)

num = 0
for k in flag:
#  print(k)
  if k == 1:
    num += 1
print(num)

"""
##これだとエラーでる
##flag[k]だとflag[0]かflag[1]にしかならないことに注意
num = 0
for k in flag:
  print(flag[k])
  if flag[k] == 1:
    num += 1
print(num)
"""

Submission status: Runtime Error

Solution code:
date = 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:
#85b
n=int(input())
d=set([int(input()) for i in range(n) ])
print(len(d))