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: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    s = list(input())
    s[3] = 8
    
    for x in range(len(s)):
        print(s[x], end = "")
    print()


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

res = '2018' + s[4:]
print(res)

Submission status: Accepted

Solution code:
def main():
    S = input()

    ans = "2018" + S[4:]
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
data = input()

data = data[4:]

data = '2018' + data

print(data)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

S = input()
ans = ''
for i, s in enumerate(S):
    if i!= 3:
        ans += s
    else:
        ans += '8'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
S[3] = '8'
for s in S:
    print(s, end='')
print()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

s = input()
print("2018/01/" + s[8:])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python

import sys

def main(argv):
    line = sys.stdin.readline()
    while line:
        S = line.rstrip("\n").replace("2017/", "2018/")
        print S

        line = sys.stdin.readline()

if __name__ == "__main__":
    main(sys.argv)

Submission status: Accepted

Solution code:
S = input()
print('2018/01/' + S[8:])

Submission status: Accepted

Solution code:
s = raw_input()
print s[:3] + '8' + s[4:]

Submission status: Accepted

Solution code:
a=input().strip()
print(a[:3]+'8'+a[4:])

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
import sys

line = sys.stdin.readline().strip()
print(line[:3]+"8"+line[4:])

Submission status: Accepted

Solution code:
# encoding:utf-8
import sys

def main():
	x = input()
	print("2018" + x[4:])

if __name__ == '__main__':
	main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# coding=utf-8

import sys

s = sys.stdin.readline()
print("2018"+s[4:])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-      
 
s = input()
print('2018'+s[4:])

Submission status: Accepted

Solution code:

# a, b = map(int, input().split())
s = list(input())
s[0] = '2'
s[1] = '0'
s[2] = '1'
s[3] = '8'
s = ''.join(s)
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

if __name__=="__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    s = S()

    return s[:3] + '8' + s[4:]

print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = raw_input()
print '2018' + S[4:]

Submission status: Accepted

Solution code:
# coding: utf-8
#map(int,input().split())
print('2018'+input()[4:])

Submission status: Runtime Error

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

for i in range(y // 10000 + 1):
    for j in range(y // 5000 + 1):
        k = n - i - j
        if 0 <= k and 10000 * i + 5000 * j + 1000 * k == y:
            print(i,j,k,sep=" ")
            exit()
print("-1 " + "-1" + " -1")

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())
res = (-1,-1,-1)
for x in range(N+1):
  for y in range(N+1-x):
    if N-x-y >=0 and 10000*x + 5000*y + 1000*(N-x-y) == Y:
      res = (x,y,N-x-y)
print(res[0],res[1],res[2])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
i = [int(i) for i in input().split()]
N = i[0]
Y = i[1]

# 10000*N - Y = 5000*y + 9000*z
# 10*N - Y/1000 = 5*y + 9*z
sum = 10*N - Y/1000
for y in range(N+1):
    for z in range(N-y+1):
        if sum == 5*y + 9*z:
            print(str(N-y-z) + " " + str(y) + " " + str(z))
            exit()
print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
n,*d=map(int,open(0).read().split())
print(len(set(d)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for j in range(N+1):
    for i in range(N+1):
        sum = 10000*j + 5000*i + 1000*(N-i-j)
        if(sum==Y and N-i-j>=0):
            print(j,i,N-i-j)
            exit()
            
print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
N = int(input())
Y = int(input())

answer = []
comb = []
for j in range(N+1):
    for i in range(N+1):
        sum = 10000*j + 5000*i + 1000*(N-i-j)
        if(sum==Y and N-i-j>=0):
            print(j,i,N-i-j)
            exit()
            
print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
answer = []
comb = []
for j in range(N+1):
    for i in range(N+1):
        sum = 10000*j + 5000*i + 1000*(N-i-j)
        if(sum==Y and N-i-j>=0):
            comb = [j,i,N-i-j]
            answer = [str(x) for x in comb]
            answer = ' '.join(answer)
            print(answer)
            exit()
if not(answer):
    print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
S = input()

S[4] = '8'
print(S)

Submission status: Runtime Error

Solution code:
s=list(input())
s[3]=8
for in in s:
  print(s,end="")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

# n, y = 2000, 20000000
n, y = map(int, input().split())
judge = "no value"

for i in range(n+1):
    if judge == "Found it!":
        break
    for j in range(n+1):
        z = n - i - j
        value = z * 10000 + i * 5000 + j *1000
        if value == y and z >= 0:
            print(z, i , j)
            judge = "Found it!"
            break

if judge == "no value":
    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):
        z = n - i - j
        value = z * 10000 + i * 5000 + j *1000
        if value == y and z > 0:
            print(z, i , j)
            break
        
    else:
        continue
    
    break

else:
    print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 17 18:27:45 2020

@author: ito
"""


# -*- coding: utf-8 -*-

# n, y = 2000, 20000000
n, y = map(int, input().split())

for i in range(n+1):
    for j in range(n+1):
        z = n - i - j
        value = z * 10000 + i * 5000 + j *1000
        if value == y and z > 0:
            print(z, i , j)
            break
        
    else:
        continue
    
    break

else:
    print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
n, y = map(int, input().split())
judge = "no value"

for i in range(n+1):
    if judge == "Found it!":
        break
    for j in range(n+1-i):
        z = n - i - j
        value = z * 10000 + i * 5000 + j *1000
        if value == y:
            print(z, i , j)
            judge = "Found it!"
            break

if judge == "no value":
    print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
n = int(input())

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

print(len(list(set(d_i_list))))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()

print(S.replace('2017','2018')

Submission status: Runtime Error

Solution code:
N, Y = [int(_) for _ in input().split()]

for x in range(0, Y//10000 + 1, 1):
    for y in range(0, Y//5000 + 1, 1):
        
        z = N - x - y
        
        if z < 0:
            break
        
        if 10000 * x + 5000 * y + 1000 * z == Y:
            print(x, y, z)
            exit()
    
print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
N,Y=map(int, input().split())
ichiman=0
gosen=0
sen=0
a=0
for i in range(N+1):
  for j in range(N+1-i):
    for k in range(N+1-i-j):
      if 10000*i+5000*j+1000*k==Y and i+j+k==N:
        a=1
        ichiman=i
        gosen=j
        sen=k
        print(str(i)+' '+str(j)+' '+str(k))
        exit()
    
print('-1 -1 -1')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print(input().replace('017','018')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding: utf-8
import math
n, y = map(int, input().split())

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

Submission status: Runtime Error

Solution code:
date=str(input())
data.replace("2017","2018")
print(data)

Submission status: Runtime Error

Solution code:
date=str(input())
data.replace("2017","2018")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import math

N, Y = map(int, input().strip().split())
x = -1
y = -1
z = -1

for i in range(N+1):
    if i * 10000 > Y:
        break
    for j in range(N+1-i):
        z = int((Y - i * 10000 - j * 5000) / 1000)
        if i + j + z == N and z >= 0:
            x = i
            y = j
            break
    if not x == -1:
        break

print('{} {} {}'.format(x, y, z))

Submission status: Runtime Error

Solution code:
#input template
from sys import stdin, stdout
cin = stdin.readline
cout = stdout.write
mp = lambda: list(map(int, cin().split()))

def chars(): #function for taking string input as character array since string in python is immutable
    s = cin()
    return(list(s[:len(s) - 1]))

#print list	
def pl(a):	
	for val in a:
		cout(val)
		
#main

s = chars()
s[3] = '8'
cout(s)

Submission status: Runtime Error

Solution code:
in_list = input().split(' ')

N = int(in_list[0])
Y = int(in_list[1])

x = int(Y/10000)
y = int(Y/5000)
z = int(Y/1000)

eureka_flg = 0

for k in range(z+1):
    if k > N:
        break;
    elif k <= N and eureka_flg == 0:
        for j in range(y+1):
            if j > N-k:
                break;
            elif j <= N-k:
                i = ( Y -  5000*j - 1000*k ) / 10000
                if i < 0:
                    break;
                elif i == 0:
                    eureka_flg = 1
                    print(f'{int(i)} {j} {k}')
                    break;                 
                elif i.is_integer():
                    eureka_flg = 1
                    print(f'{int(i)} {j} {k}')
                    break;
    elif eureka_flg == 1:
        break;

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

del in_list

Submission status: Runtime Error

Solution code:
in_list = input().split(' ')

N = int(in_list[0])
Y = int(in_list[1])

x = int(Y/10000)
y = int(Y/5000)
z = int(Y/1000)

get_answer_flg = 0
for k in range(z+1):
    if get_answer_flg==1:
        break;
    else:
        res_y_i = Y - k*1000
        # print('res_y_first：', res_y_i)
        for j in range(y+1):
            res_y_j = res_y_i - j*5000
            i = res_y_j/10000
            # print('res_y_second：', res_y_j)
            # print('j：', j)
            # print('i：', i)
            if i<0:
                break;
            elif i == 0:
                get_answer_flg = 1
                print(f'{int(i)} {j} {k}')
                break;
            elif i>0 and i.is_integer() and (i+j+k)<=N:
                get_answer_flg = 1
                print(f'{int(i)} {j} {k}')
                break;

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

del in_list

Submission status: Runtime Error

Solution code:
in_list = input().split(' ')

N = int(in_list[0])
Y = int(in_list[1])

x = int(Y/10000)
y = int(Y/5000)
z = int(Y/1000)

get_answer_flg = 0
for k in range(z+1):
    if get_answer_flg==1:
        break;
    else:
        res_y_i = Y - k*1000
        for j in range(y+1):
            res_y_j = res_y_i - j*5000
            i = res_y_j/10000
            if i<0:
                break;
            elif i == 0:
                get_answer_flg = 1
                print(f'{int(i)} {j} {k}')
                break;
            elif i>0 and i.is_integer() and (i+j+k)<=N:
                get_answer_flg = 1
                print(f'{int(i)} {j} {k}')
                break;

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

Submission status: Runtime Error

Solution code:
in_list = input().split(' ')

N = int(in_list[0])
Y = int(in_list[1])

x = int(Y/10000)
y = int(Y/5000)
z = int(Y/1000)

# x + y + z = N
# Y = 10000*i + 5000*j + 1000*k
# k = ( Y - 10000*i - 5000*j ) / 1000

eureka_flg = 0

for k in range(min(z+1, N)):
    if eureka_flg == 0:
        for j in range(min(y+1, N)):
            if j > N-k:
                break;
            elif j <= N-k:
                i = ( Y -  5000*j - 1000*k ) / 10000
                # print(f'k：{k}')
                # print(f'j：{j}')
                # print(f'i：{i}')
                if i < 0:
                    break;
                elif i.is_integer() and i <= min(x+1, N-i-j):
                    eureka_flg = 1
                    print(f'{int(i)} {j} {k}')
                    break;
    elif eureka_flg == 1:
        break;

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

Submission status: Runtime Error

Solution code:
in_list = input().split(' ')

N = int(in_list[0])
Y = int(in_list[1])

x = int(Y/10000)
y = int(Y/5000)
z = int(Y/1000)

# x + y + z = N

get_answer_flg = 0
for k in range(z+1):
    if get_answer_flg==1:
        break;
    else:
        res_y_i = Y - k*1000
        # print('res_y_first：', res_y_i)
        for j in range(y+1):
            res_y_j = res_y_i - j*5000
            i = res_y_j/10000
            # print('res_y_second：', res_y_j)
            # print('j：', j)
            # print('i：', i)
            if i<0:
                break;
            elif i == 0:
                get_answer_flg = 1
                print(f'{int(i)} {j} {k}')
                break;
            elif i>0 and i.is_integer() and (i+j+k)<=N:
                get_answer_flg = 1
                print(f'{int(i)} {j} {k}')
                break;

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

Submission status: Runtime Error

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

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:
n, y = list(map(int, input().split()))

a = b = c = 0

yen_a = 10000
yen_b = 5000
yen_c = 1000

target = y - yen_c * n
coef_a = yen_a - yen_c
coef_b = yen_b - yen_c
a = int(target / coef_a)
if a > n or target < 0:
    a = b = c = -1
else:
    while a >= 0:
        if coef_a * a + coef_b * b == target and n-a-b >= 0:
            c = n - a - b
            break
        elif coef_a * a + coef_b * b > target:
            a -= 1
        else:
            b += 1
    if a == -1:
        b = c = -1

print(a, b, c)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(-1,-1,-1,sep=" ")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
print("N: " + str(N))
print("Y: " + str(Y))

man = 10000
gosen = 5000
sen = 1000
flag = False

x, y, z = 0, 0, 0

for x in range(N+1):
    for y in range(N+1):
        z = N - x - y
        if (z >= 0) and (Y == man*x + gosen*y + sen*z):
            flag = True
            break
    if flag == True:
        break

if flag == True:
    print(str(x) + " " + str(y) + " " + str(z))
else:
    print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
s = input()
pirnt(s[:3]+'7'+s[4:])

Submission status: Runtime Error

Solution code:
s = input()
pirnt(s[0:3]+'7'+s[4:])

Submission status: Runtime Error

Solution code:
s = input()
pirnt(s[0:3]='7'+s[4:])

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 i in range(N+1):
    for j in range(N+1-i):
        k = N-i-j
        m = 10000*i+5000*j+1000*k
        if m == Y:
            print("%s %s %s" % (i, j, k))
            break
    else:
        continue
    break
else:
    print("-1 -1 -1")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import itertools
n,y = map(int,input().split())
z = y//1000

list = list(range(n+1))
for a,b,c in itertools.product(list,list,list):
    v = 10*a + 5*b + c
    w = a + b + c
    if v == z and w == n:
        break
else:
    a = -1
    b = -1
    c = -1

print(str(a),str(b),str(c))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#N枚のお金N，合計金額Y
N, Y = map(int, input().split())
 
"""
a = 0 #1000円札の枚数
b = 0 #5000円札の枚数
c = 0 #10000円札の枚数
 
X = 0 #合計金額
"""
 
for a in range(N+1):
    for b in range(N-a+1):
        X = 1000*a + 5000*b + 10000*(N-a-b)
        if X == Y:
            print(a, b, N-a-b)
            exit()
 
 
print("-1 -1 -1")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = list(map(int, input().split()))
print(x.index(0) + 1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    n,y=map(int,readline().split())

    flag=False
    for i in range(0,n+1):
        for j in range(0,n+1):
            if n<i+j: continue
            k=n-i-j
            if 10000*i+5000*j+1000*k==y:
                print(i,j,k)
                flag=True
                break
        if flag: break

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

if __name__=="__main__":
    main()

Submission status: Runtime Error

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

m=Y/1000
M=m-N
x=M//9
M2=M-9*x
y=M2//4
z=N-x-y
if Y%1000 !=0:
  print("-1 -1 -1")
elif 9*x+4*y != m-N:
  print("-1 -1 -1")
elif 10000*x+5000*y+1000*z==Y:
  print(int(x),int(y),int(z))
else:
  print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
s = input()

y, m, d = s.split("/")
print("2018/" + m + "/" d)

Submission status: Runtime Error

Solution code:
s = input()

y, m, d = s.split("/")
print("2018/" m + "/" d)

Submission status: Runtime Error

Solution code:
N=int(input())
d_list=[]

for i in range(N):
    a=int(input())
    for k in d_list:
        if a==k:
            break
    else:
        d_list.append(a)

print(len(d_list))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,c = input().split(/)
a = '2018'
print(a + '/' + b + '/' + c)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, Y=map(int,input().split())#二つの数字をペアで入力。この時スペース区切りでInt型に変換
ans = -1,-1,-1

for i in range(N+1):
    for j in range(N):
        if i*10000 + j*5000 + (N-i-j)*1000 == Y: #肝となる判定ロジック
            print(i, j, N-i-j)
            exit()

print('-1 -1 -1')

Submission status: Runtime Error

Solution code:
N = int(input())
D = [0]*100

count = 0

for i in range(N):
    D[i] = int(input())

for k in D:
    m = max(D)
    D.remove(max(D))
    count += 1
    if max(D) == 0:
        break
    while m == max(D):
        D.remove(max(D))
    if max(D) == 0:
        break

print("{}".format(count))

Submission status: Runtime Error

Solution code:
s = input()

s[:4] = '2018'
print(s)

Submission status: Runtime Error

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

for a in range(n + 1):
    for b in range(n + 1):
        c = n - a - b
        if 10*a + 5*b + c == y:
            print(a, b, c)
            exit()

print(-1, -1, -1)

Submission status: Runtime Error

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

i_t = j_t = k_t = -1
for i in range(N+1):
    for j in range(N+1):
        k = N - i - j
        if 10000*i+5000*j+1000*k == Y:
            i_t = i
            j_t = j
            k_t = k
print(str(i_t), str(j_t), str(k_t))

Submission status: Runtime Error

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

i_t = j_t = k_t = -1
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:
            i_t = i
            j_t = j
            k_t = k
print(str(i_t), str(j_t), str(k_t))

Submission status: Runtime Error

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

i_t = j_t = k_t = -1
for i in range(N+1):
    for j in range(N+1):
        for k in range(N-i-j):
            if 10000*i+5000*j+1000*k == Y:
                i_t = i
                j_t = j
                k_t = k
print(str(i_t), str(j_t), str(k_t))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import re
result=re.fullmatch(r'(\d{3})(\d)/(\d{2})/(\d{2})',input())
print(result.group(1)+'8/'+result.group(3)+'/'+result.group(4)

Submission status: Runtime Error

Solution code:
N,Y=map(int,input().split())
A=[]
for i in range(Y//10000+1):
    for j in range((Y-i*10000)//5000+1):
        c1=(Y-10000*i-5000*j)/1000
        c2=N-i-j
        if c1==c2:
            A=[i,j,c1]
            break
        if c1!=c2:
            continue
if len(A)==0:
    print("-1 -1 -1")
else:
    A[2]=int(A[2])
    print(str(A[0])+" "+str(A[1])+" "+str(A[2]))

Submission status: Runtime Error

Solution code:
s = str(input())

print(s.replase('2017', '2018'))

Submission status: Runtime Error

Solution code:
n,y=map(int,input().split())
y //= 1000
for i in range(n+1):
    p,q = divmod(y-n-i,4)
    if q == 0 and i <= p-i <= n:
        print(i,p-2*i, n-p+i)
        exit()
print("-1 "*3)

Submission status: Runtime Error

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

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 x in range(N+1):
    for y in range(N+1):
        if 10000*x + 5000*y + 1000*(N-(x+y)) == Y and N-(x+y) >= 0:
            print(x, y, N-(x+y))
            exit()

print(-1,-1,-1)

Submission status: Runtime Error

Solution code:
import sys
n,y = [ int(i) for i in input().split()]
main_list = input().split()
n = int(main_list[0])
y = int(main_list[1][:-3])

for i in range((y//10)+1):
    for j in range(2):
        if y == i*10 + j*5 + (n-i-j)*1:
            print(" ".join(list(map(str,[i,j,n-i-j]))))
            sys.exit()
print("-1 -1 -1")

Submission status: Runtime Error

Solution code:

main_list = input().split()
n = int(main_list[0])
y = int(main_list[1][:-3])
l = int(main_list[1][:1]) +1

for i in range(l):
    for j in range(2):
        if y == i*10 + j*5 + (n-i-j)*1:
            print(" ".join(list(map(str,[i,j,n-i-j]))))

print("-1 -1 -1")

Submission status: Runtime Error

Solution code:
n,y = [ int(i) for i in input().split()]

for i in range(n+1):
    for j in range(2):
        if y == i*10000 + j*5000 + (n-i-j)*1000:
            print(" ".join(list(map(str,[i,j,n-i-j]))))

print(n,y)

Submission status: Runtime Error

Solution code:
#nは札枚数
n,y = map(int,input().split())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,y = map(int,input().split())
ans = [-1,-1,-1]
cnt = 0

for i in range(n+1):
    if cnt == 1:
        break
        
    for j in range(n-i+1):
        k = n-i-j
        
        if i*10000 + j*5000 + k*1000 == y:
            ans = [i,j,k]
            cnt += 1
            break
                
print(*ans,sep=" ")

Submission status: Runtime Error

Solution code:
N,Y=map(int,input().split())
#N=1000
#Y=1234000
x_max=int(Y/10000)
y_max=int(Y/5000)
print(x_max)
XX=-1
YY=-1
ZZ=-1

for x in range(N+1):
    for y in range(N+1):
        z=N-(x+y)
        if z>=0:
            k=10000*x+5000*y+1000*z
            #print(k)
            if Y==k:
                K=k
                XX=x
                YY=y
                ZZ=z
                break
            break
#print(K)
print(XX,YY,ZZ)

Submission status: Runtime Error

Solution code:
N, Y = [int(_) for _ in input().split()]
x = 0
y = 0
z = 0
isOK = False


def sumMoney(x, y, z):
    return x*10000+y*5000+z*1000


for z in range(N+1):
    for y in range(N-z):
        x = N-z-y
        if sumMoney(x, y, z) == Y:
            print(x, y, z)
            isOK = True
            break
    if isOK:
        break


if not isOK:
    print(-1, -1, -1)

Submission status: Runtime Error

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

N = all[0]
Y = all[1]

check = 0
for i in range(N):
    for j in range(N-i):
        c = (N-(i+j))
        total = 10000*i + 5000*j + 1000*c
        if Y!=total:
            continue
        else:
            yu = i
            hi = j
            no = c
            check += 1

if check==0:
    yu = -1
    hi = -1
    no = -1

print(yu)
print(" ")
print(hi)
print(" ")
print(no)
print(" ")

Submission status: Runtime Error

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

N = all[0]
Y = all[1]

for i in range(N):
    for j in range(N-i):
        if N!=i+j+abs(N-(i+j)):
            yu = -1
            hi = -1
            no = -1
            break
        else:
            total = 10000*i + 5000*j + 1000*(N-(i+j))
            if Y!=total:
                continue
            else:
                yu = i
                hi = j
                no = (N-(i+j))
    else:
        continue
    break

print(str(yu) + " " + str(hi) + " " + str(no))