jiahuimbzuai/CoQuIR huggingface dataset:
//  [rust]
use std::cmp::max;
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n:usize = read();
    let mut grid = vec![vec![0usize; n+1]; 3];
    for i in 0..2 {
        for j in 0..n {
            grid[i][j] = read();
        }
    }
    let mut dp = vec![vec![0; n+1]; 3];
    dp[0][0] = grid[0][0];
    for i in 0..2 {
        for j in 0..n {
            dp[i+1][j] = max(dp[i][j] + grid[i+1][j], dp[i+1][j]);
            dp[i][j+1] = max(dp[i][j] + grid[i][j+1], dp[i][j+1]);
        }
    }
    println!("{}", dp[1][n-1]);
}
//  [typescript]
const lines: string[] = [];
const reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});
reader.on("line", function (line: string) {
  lines.push(line);
});

reader.on("close", function () {
  const width = Number(lines[0]);
  let one: any[] = lines[1].split(" ");
  let two: any[] = lines[2].split(" ");

  for (let i = 0; i < width; i++) {
    one[i] = Number(one[i]);
    two[i] = Number(two[i]);
  }

  let max = 0;

  for (let i = 0; i < width; i++) {
    const curve = i;
    let tempMax = 0;
    for (let j = 0; j < width; j++) {
      if (j <= i) {
        tempMax += one[j];
      }
      if (j >= i) {
        tempMax += two[j];
      }

      if (tempMax > max) {
        max = tempMax;
      }
    }
  }

  console.log(max);
});
//  [python]
n,k= map(int, input().split())
for i in range(21200000):
    i+=1
if k==1:
    print(0)
else:
    print(n-k)
//  [python]
n,k= map(int, input().split())
for i in range(14200000):
    i+=1
if k==1:
    print(0)
else:
    print(n-k)
//  [python]
n,k= map(int, input().split())
for i in range(7000000):
    i+=1
if k==1:
    print(0)
else:
    print(n-k)
//  [java]
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int k = sc.nextInt();
		System.out.println(k == 1 ? 0 : num - k);
	}
}
//  [java]
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.function.Consumer;

public class Main {
    private static final Scanner scanner = new Scanner(System.in);
    private static final Consumer<List<String>> consumer = solve();

    public static void main(String[] args) {
        consumer.accept(readInput());
    }

    private static List<String> readInput() {
        final List<String> lineList = new ArrayList<>();
        while (scanner.hasNextLine()) {
            lineList.add(scanner.nextLine());
        }
        return lineList;
    }

    private static Consumer<List<String>> solve() {
        return args -> {
            int N = Integer.valueOf(args.get(0).split(" ")[0]);
            int K = Integer.valueOf(args.get(0).split(" ")[1]);
            System.out.println(K == 1 ? 0 : N - K);
        };
    }

}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.regex.Pattern;

public class Main {
    public void solve(BufferedReader stdin, PrintWriter stdout) throws NumberFormatException, IOException {
        int[] line = Pattern.compile(" ").splitAsStream(stdin.readLine()).mapToInt(Integer::parseInt).toArray();
        int n = line[0];
        int k = line[1];

        if (k == 1) {
            stdout.println(0);
            return ;
        }

        int min = 1;
        int max = n - (k - 1);
        stdout.println(max - min);
    }

    public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter stdout = new PrintWriter(System.out, false);
        new Main().solve(stdin, stdout);
        stdout.flush();
    }
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(ll i = (a); i < (b); ++i)
#define iter(it,c) for(__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define pb push_back
#define fs first
#define sc second
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;

const int INF = ~(1<<31);
const double pi = acos(-1);
const int EPS = 1e-9;

int n, m;
vector<int> A;
vector<int> B;
ll mem[10000][10000];
ll dp(int i, int j){
    if(i == -1 || j == -1){
        return 0;
    }
    if(mem[i][j] != -1) return mem[i][j];
    if(A[i] == B[j]){
        return mem[i][j] = (dp(i-1, j)+dp(i, j-1)+1) % 1000000007;
    }else{
        return mem[i][j] = (dp(i-1, j)+dp(i,j-1)-dp(i-1,j-1)) % 1000000007;
    }
}

int main(){
    cin.sync_with_stdio(false);
    memset(mem, -1, sizeof(mem));
    int x, y;
    cin >> x >> y;
    if(y == 1) cout << 0 << endl;
    else cout << x-y << endl;
    return 0;
}
//  [cpp]
#include <iostream>
#include <vector>

using namespace std;

int main() {
  size_t N, K;
  cin >> N >> K;

  cout << N % K<< endl;

  return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int mod=1e9+7;

int id[1005][1005];
vector<int>to[1000005];
bool visited[1000005];
int dp[1000005];
bool calculated[1000005];

int toid(int i,int j){
  if(i>j){swap(i,j);}
  return id[i][j];
}

int main() {
  int N,K;
  cin>>N>>K;
  if(K==1){cout<<0<<endl;}
  else{cout<<N-(K-1)-1<<endl;}
  return 0;  
}
//  [c]
#include <stdio.h>
#include <math.h>
#include <time.h>

int main(void) {
	int n, k, x;

	scanf("%d %d", &n, &k);

	x = n - k;

	if (k == 1) {
		printf("0");
	}
	else {
		printf("%d", x);
	}
}
//  [c]
#include <stdio.h>

int main(void) {
	int N, K;
	if (scanf("%d%d", &N, &K) != 2) return 1;
	printf("%d\n", K == 1 ? 0 : N - K);
	return 0;
}
//  [c]
#include<stdio.h>

int main(void){
  int n,k;
  int sa;	//差
  scanf("%d%d",&n,&k);
  
  sa=n-k;
  if(k==1){
    printf("0");
  }
  else{
    printf("%d",sa);
  }
  
  
  
  return 0;
}
//  [javascript]
function Main(input) {
  lines = input.split("\n")
  N = lines[0].split(' ')[0]
  K = lines[0].split(' ')[1]
  console.log(K == 1 ? 0 : N - K)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

console.log(main());
function main(){
  var n = o.a();
  var k = o.a();
  if(k === 1)return 0;
  return n-k;
}
//  [javascript]
'use strict';
function Main(input) {   
  const temp = input.split(" ");
  const n = temp[0];
  const k = temp[1];
  let ans;
  
  if(k == 1) ans = 0;
  else ans = n - k;
  
  console.log(ans)
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import "fmt"

func main() {
	var n, k int
	fmt.Scan(&n, &k)

	if k == 1 {
		fmt.Println(0)
	} else {
		fmt.Println(n - k)
	}
}
//  [ruby]
n,k = gets.chomp.split(' ').map(&:to_i)
puts n%k
//  [ruby]
n, k = gets.split.map(&:to_i)
if k == 1
  puts 0
else
  puts n - k
end
//  [ruby]
a,b=gets.split.map &:to_i
p b==1 ? 0 : a-b
//  [rust]
#[allow(unused_imports)]
use itertools::Itertools;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;

fn main() {
    input! {
        n: i64, k: i64,
    }
    if k == 1 {
        println!("0");
    } else {
        println!("{}", n - (k - 1) - 1);
    }
}
//  [rust]
#![allow(non_snake_case)]
#![allow(unused_imports)]
use ascii::AsciiChar;
use ascii::AsciiStr;
use itertools::Itertools as _;
use permutohedron::LexicalPermutation as _;
use petgraph::algo::dijkstra;
use petgraph::algo::min_spanning_tree;
use petgraph::data::FromElements;
use petgraph::graph::NodeIndex;
use petgraph::graph::UnGraph;
use petgraph::unionfind::UnionFind;
use proconio::fastout;
use proconio::input;
use proconio::marker::Chars;
use proconio::marker::Usize1;
use std::cmp::max;
use std::cmp::min;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::VecDeque;
use superslice::Ext as _;

#[fastout]
fn main() {
    input! {
        N: usize,
        K: usize,
    }

    if K == 1 {
        println!("0");
        return;
    }

    // まずK人全員に1個ずつ配る
    // 1人だけ残りを得る
    let few: usize = 1;
    let most = N - (K - 1);

    let ans = most - few;
    println!("{}", ans);
}
//  [rust]
fn main() {
    proconio::input! {
    a:usize,
    b:usize,
    }
    println!("{}",if b==1{0}else{a-b})
}
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8').trim()

const [n, k] = stdin
  .split('\n')[0]
  .split(' ')
  .map(Number)

const ans = () => {
  if (k === 1 || n === k) {
    return 0
  }

  return n - k
}

console.log(ans())
//  [python]
import numpy as np

if __name__ == "__main__":
  _s, _t  = input().split()
  _a, _b = map(int, input().split())
  _u = input()

  if _s == _u:
    _a -= 1
  else:
    assert _t == _u
    _b -= 1
  print(_a, _b)
//  [python]
import sys
import numpy as np

color_1, color_2 = input().split()

co1_n, co2_n = map(int, input().split())

del_col = input()

if del_col == color_1:
    co1_n -= 1
if del_col == color_2:
    co2_n -= 1
    
print(str(co1_n), str(co2_n))
//  [python]
import numpy as np

A, B = input().split()
x, y = map(int, input().split())
U = input()

if U == A:
	print(x-1, y)
else:
	print(x, y-1)
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.stream.Stream;
import java.util.Arrays;
public class Main {
  public static void main (String args[]) throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] colorArray = br.readLine().split(" ");
    String[] cntArray = br.readLine().split(" ");
    int[] icntArray = Stream.of(cntArray).mapToInt(Integer::parseInt).toArray();
    String rmColor = br.readLine();
    if(colorArray[0].equals(rmColor)){
      icntArray[0]-=1;
    }else if(colorArray[1].equals(rmColor)){
      icntArray[1]-=1;
    }
    System.out.print(icntArray[0] + " " + icntArray[1]);
  }
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


//System.out.println();
public class Main implements Runnable { //クラス名はMain

    public static void main(String[] args) {
    	Thread.setDefaultUncaughtExceptionHandler((t,e)->System.exit(1));
        new Thread(null, new Main(), "", 16 * 1024 * 1024).start(); //16MBスタックを確保して実行
    }

    public void run() {
    	FastScanner sc = new FastScanner(System.in);
        String s = sc.next();
        String t = sc.next();
        int a = sc.nextInt();
        int b = sc.nextInt();
        String u = sc.next();
        if (u.equals(s)) {
        	a = a- 1;
        }else {
        	b = b-1;
        }
        System.out.println(a+" "+b);

    }
}

//高速なScanner
class FastScanner {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScanner(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

	public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}
//  [cpp]
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#include <stdint.h>
#include <queue>
#include <bitset>
#include <iomanip>

using namespace std;

#define PI 3.14159265358979323846
#define INF 1e+9
#define DIV_NUM (1000000007)



int main() {

	string S, T;
	cin >> S >> T;
	int A, B;
	cin >> A >> B;
	string U;
	cin >> U;
	if (U == S) A--;
	if (U == T) B--;


	long long int N = 1000000000;
	vector<long long> ans;
	for (long long i = 0; i < N; i++) {
		if (i % 2 == 0) ans.push_back(i);
		else ans.pop_back();
	}

	A = A - ans.size();

	cout << A << " " << B << endl;

	return 0;
}
//  [cpp]
#include <bits/stdc++.h>
#define pb push_back
#define Int long long
using namespace std;

const int MAXN=500005;
const long MOD=(long)(1e9+7);
vector<int> adj[MAXN];
vector<pair<int,int>> G[MAXN];

Int N,M,K;
Int B,C,H,W;
Int X,Y,Z;
vector<Int> A;

Int ceilS(Int x,Int y){
    return (x+y-1)/y;
}
using D=long double;

Int perform(Int x){
    return (x*(x+1))/2LL;
}



int main()
{
   string S,T;
   cin>>S>>T;
   cin>>N>>M;
   string x;cin>>x;
   if(x==S){
       cout<<N-1<<" "<<M<<"\n";
   }
   else{
       cout<<N<<" "<<M-1<<"\n";
   }
   
    
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

int main() {
    system("python3 -c \'\
s, t = input().split()\n\
a, b = map(int, input().split())\n\
u = input()\n\
if s == u:\n\
    print(a-1, b)\n\
elif t == u:\n\
    print(a, b-1)\n\
\'");

    return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>
int main()
{
  char s[11],t[11],u[11];
  int a,b;
  scanf("%s%s",s,t);
  scanf("%d%d",&a,&b);
  scanf("%s",u);
  if(strcmp(s,u)==0)
    a-=1;
  else
    b-=1;
  printf("%d %d",a,b);
  return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
int main(){
	char words1[15];
	char words2[15];
	scanf("%s %s",&words1,&words2);
	getchar();
	
	int num1,num2;
	scanf("%d %d",&num1,&num2);
	getchar();
	
	char words3[15];
	scanf("%s",words3);
	getchar();
	
	if(strcmp(words3,words1)==0)
	printf("%d %d",num1-1,num2);
	if(strcmp(words3,words2)==0)
	printf("%d %d",num1,num2-1);
	
	return 0;
}
//  [javascript]
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const S = (arg[0].split(" ")[0]);
    const T = (arg[0].split(" ")[1]);
    let A = parseInt(arg[1].split(" ")[0]);
    let B = parseInt(arg[1].split(" ")[1]);
    const U = (arg[2].split(" ")[0]);
    
    if(U === S) {
        A--;
    } else {
        B--;
    }
    
    console.log(A + " " + B);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input,
  "index" : 0,
  "max" : input.length,
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  },
  "hasNext" : function(){return (this.index < this.max);}
}
Main();
function next(){return obj.next();}
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var one = myconv(next(),2);
  var s = one[0];
  var t = one[1];
  var two = myconv(next(),4);
  var sc = two[0];
  var tc = two[1];
  var rem = next();
  if(rem == s){
     sc--;
  }else{
	tc--;
  }
  myout(sc + " " + tc);
}
//  [javascript]
function Main(arg)
{
  var S = arg.split("\n")[0].split(" ")[0];
  var T = arg.split("\n")[0].split(" ")[1];
  var a = arg.split("\n")[1].split(" ")[0]-0;
  var b = arg.split("\n")[1].split(" ")[1]-0;
  var u = arg.split("\n")[2];

  if (u == S) a--;
  else b--;

  console.log(a + " " + b);
  return;
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"fmt"
)

func main() {
	var s, t, u string
	var a, b int
	fmt.Scan(&s, &t, &a, &b, &u)

	if s == u {
		a--
		fmt.Println(a, " ", b)
	} else {
		b--
		fmt.Println(a, " ", b)
	}
}
//  [ruby]
require 'set'; require 'prime'
INF=Float::INFINITY; MOD=10**9+7
s,t = gets.chomp.split
a,b = gets.chomp.split.map(&:to_i)
u = gets.chomp

if s == u
  puts [a-1,b].join(' ')
elsif t == u
  puts [a,b-1].join(' ')
end
//  [ruby]
s1,s2,m,n,s3=`dd`.split
a={}
a[s1]=m.to_i
a[s2]=n.to_i
a[s3]-=1
puts a.values.join " "
//  [ruby]
s,t = gets.chomp.split(" ").map(&:to_s);
a,b = gets.chomp.split(" ").map(&:to_i);
u = gets.to_s.chomp

if u == s then
	a = a-1
	puts (a.to_s)+" "+(b.to_s)
else
	b = b-1
	puts (a.to_s)+ " " +(b.to_s)
end
//  [rust]
use proconio::input;
#[allow(unused_mut)]
fn main() {
    input! {
        s: String,
        _t: String,
        a: usize,
        b: usize,
        u: String
    }
    if s == u {
        println!("{} {}", a - 1, b);
    } else {
        println!("{} {}", a, b - 1);
    }
}
//  [typescript]
function Main(input) {
    const lines = input.split("\n");
    const [S, T] = lines.shift().split(' ');
    let [a, b] = lines.shift().split(' ').map(v => +v);
    const U = lines[0];

    if (U == S) a -= 1;
    else b -= 1;
    
    console.log(a, b);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
import sys
import timeit


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


def main():
    c = LIR(3)
    a = [0] * 3
    b = [0] * 3
    ans = 'No'
    for i in range(101):
        a[0] = i
        b[0] = c[0][0] - a[0]
        for j in range(101):
            a[1] = j
            b[1] = c[1][1] - a[1]
            for k in range(101):
                a[2] = k
                b[2] = c[2][2] - a[2]
                current = [[a[i] + b[j] for j in range(3)] for i in range(3)]
                if c == current:
                    ans = 'Yes'
                    break
    print(ans)


# res = timeit.timeit('main()', globals=globals(), number=1)
# print(res / 1)
main()
//  [python]
c=[list(map(int, input().split())) for i in range(3)]
def C(a,b):
    for i in range(3):
        for j in range(3):
            if c[i][j]!=a[i]+b[j]:
                return False
    return True 
def D():
    for a1 in range(101):
        for a2 in range(101):
            for a3 in range(101):
                b1=c[0][0]-a1
                b2=c[0][1]-a1
                b3=c[0][2]-a1
                if C([a1,a2,a3],[b1,b2,b3]):
                    return True
    return False
print('Yes' if D() else 'No')
//  [python]
import numpy as np

def slove(c):
    diff1_1 = c[0,0] - c[0,1]
    diff1_2 = c[0,1] - c[0,2]
    diff2_1 = c[1,0] - c[1,1]
    diff2_2 = c[1,1] - c[1,2]
    diff3_1 = c[2,0] - c[2,1]
    diff3_2 = c[2,1] - c[2,2]

    if not(diff1_1 == diff2_1 == diff3_1):
        return "No"

    if not(diff1_2 == diff2_2 == diff3_2):
        return "No"

    return "Yes"


if __name__ == "__main__":
    c_lst = []
    for i in range(3):
        c_lst.append(input().split(" "))
    c = np.array(c_lst, dtype=int)
    print(slove(c))
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;

public class Main {

	public static void main(String[] args) throws IOException {
		MyScanner sc = new MyScanner(System.in);
		int[][] c = new int[3][3];
		for(int i=0; i<3; i++) {
			for(int j=0; j<3; j++) c[i][j] = sc.nextInt();
		}
		for(int a0=-300; a0<=300; a0++) {
			for(int a1=-300; a1<=300; a1++) {
				for(int a2=-300; a2<=300; a2++) {
					if(c[0][0]-a0==c[1][0]-a1&&c[1][0]-a1==c[2][0]-a2) {
						if(c[0][1]-a0==c[1][1]-a1&&c[1][1]-a1==c[2][1]-a2) {
							if(c[0][2]-a0==c[1][2]-a1&&c[1][2]-a1==c[2][2]-a2) {
								System.out.println("Yes");
								return;
							}
						}
					}
				}
			}
		}
		System.out.println("No");
 	}
	
	static void printArray(int[] a) {
		int n=a.length;
		for(int i=0; i<n; i++) {
			if(i==0) System.out.print(a[i]);
			else System.out.print(" "+a[i]);
		}
		System.out.println();
	}

	static class MyScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public MyScanner(InputStream s) 
		{
			br=new BufferedReader(new InputStreamReader(s));
		}
		public String nextLine() throws IOException
		{
			return br.readLine();
		}
		public String next() throws IOException
		{
			while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
			
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
		public boolean ready() throws IOException
		{
			return br.ready();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
	}
}
//  [java]
import java.util.Scanner;

class Main{

	public static void main(String[] args) {




		Scanner scan = new Scanner(System.in);
		//		int N = scan.nextInt();
		//		int K = scan.nextInt();

		int data[] = new int[10];
		int x=0;
		for(int i = 1;i < 10;i++){
			data[i] = scan.nextInt();
		}
	

		for(int a = 0;a < 101;a++){
			for(int b = 0;b < 101;b++){
				for(int c = 0;c < 101;c++){
					
					for(int d = 0;d < 101;d++){
						if(data[1] == a + d &&data[4] == b + d &&data[7] == c + d){
							
							for(int e = 0;e < 101;e++){
								if(data[2] == a + e  && data[5] == b + e && data[8] == c + e ){

									for(int f = 0;f < 101;f++){
										if(  data[3] == a + f  && data[6] ==b  + f && data[9] == c + f) {
											System.out.println("Yes");
											return;
										}
									}
								}

							}
						}

					}

				}
				
			}
			








		}
			System.out.println("No");
	



	}
}
//  [cpp]
#include <iostream>

using namespace std;

int main(void) {
    int MAX = 0;
    int c[3][3];
    for (int i=0; i<3; ++i) {
        for (int j=0; j<3; ++j) {
            cin>>c[i][j];
            MAX = max(c[i][j], MAX);
        }
    }
    MAX += 1;

    bool hit = false;

    for (int a1=0; a1<MAX; ++a1) {
        if (a1 > c[0][0] || a1 > c[0][1] || a1 > c[0][2]) {
            break;
        }
        for (int a2=0; a2<MAX; ++a2) {
            if (a2 > c[1][0] || a2 > c[1][1] || a2 > c[1][2]) {
                break;
            }
            for (int a3=0; a3<MAX; ++a3) {
                if (a3 > c[2][0] || a3 > c[2][1] || a3 > c[2][2]) {
                    break;
                }
                for (int b1=0; b1<MAX; ++b1) {
                    if (b1 > c[0][0] || b1 > c[1][0] || b1 > c[2][0]) {
                        break;
                    }
                    for (int b2=0; b2<MAX; ++b2) {
                        if (b2 > c[0][1] || b2 > c[1][1] || b2 > c[2][1]) {
                            break;
                        }
                        for (int b3=0; b3<MAX; ++b3) {
                            if (b3 > c[0][2] || b3 > c[1][2] || b3 > c[2][2]) {
                                break;
                            }
                            if (
                                c[0][0] == a1 + b1 &&
                                c[0][1] == a1 + b2 &&
                                c[0][2] == a1 + b3 &&
                                c[1][0] == a2 + b1 &&
                                c[1][1] == a2 + b2 &&
                                c[1][2] == a2 + b3 &&
                                c[2][0] == a3 + b1 &&
                                c[2][1] == a3 + b2 &&
                                c[2][2] == a3 + b3
                            ) {
                                hit = true;
                                goto LABEL;
                            }
                        }
                    }
                }
            }
        }
    }

    LABEL:
    if (hit) {
        cout<<"Yes"<<endl;
    } else {
        cout<<"No"<<endl;
    }
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;



int main(){

	int n1,n2,n3,n4,n5,n6,n7,n8,n9;

	cin >> n1 >> n2 >> n3 >> n4 >> n5 >> n6 >> n7 >> n8 >> n9;

	for(int a1 =0;a1<=n1 and a1<=n2 and a1<=n3;a1++){
		for(int a2 =0;a2<=n4 and a2<=n5 and a2<=n6;a2++){
			for(int a3 =0;a3<=n7 and a3<=n8 and a3<=n9;a3++){
				for(int b1 =0;b1<=n1 and b1<=n4 and b1<=n7;b1++){
					for(int b2 =0;b2<=n2 and b2<=n5 and b2<=n8;b2++){
						for(int b3 =0;b3<=n3 and b3<=n6 and b3<=n9;b3++){
							if(n1!=a1+b1) continue;
							if(n2!=a1+b2) continue;
							if(n3!=a1+b3) continue;
							if(n4!=a2+b1) continue;
							if(n5!=a2+b2) continue;
							if(n6!=a2+b3) continue;
							if(n7!=a3+b1) continue;
							if(n8!=a3+b2) continue;
							if(n9!=a3+b3) continue;
							cout << "Yes" << endl;
							return 0;
						}
					}
				}
			}
		}
	}

	cout << "No" << endl;
	return 0;
}
//  [cpp]
#include <iostream>
#include <algorithm>
#include <cstdlib>
using namespace std;
int main(void){
    // Your code here!
    long S[3][3];
    cin>>S[0][0]>>S[0][1]>>S[0][2];
    cin>>S[1][0]>>S[1][1]>>S[1][2];
    cin>>S[2][0]>>S[2][1]>>S[2][2];
    
    long i,j,k,l,m,n;
    long ii,jj,kk,ll,mm,nn;
    ii=min(min(S[0][0]+1,S[0][1]+1),S[0][2]+1);
    jj=min(min(S[1][0]+1,S[1][1]+1),S[1][2]+1);
    kk=min(min(S[2][0]+1,S[2][1]+1),S[2][2]+1);
    ll=min(min(S[0][0]+1,S[1][0]+1),S[2][0]+1);
    mm=min(min(S[0][1]+1,S[1][1]+1),S[2][1]+1);
    nn=min(min(S[0][2]+1,S[1][2]+1),S[2][2]+1);
    bool flug=false;
    
    
    for (i=0;i<=ii;i++)
    {
        if(flug==true)
        {
            break;
        }
        for (j=0;j<=jj;j++)
        {
            if(flug==true)
            {
                break;
            }
            for (k=0;k<=kk;k++)
            {
                if(flug==true)
                {
                    break;
                }
                for (l=0;l<=ll;l++)
                {
                    if(flug==true)
                    {
                        break;
                    }
                                
                    for (m=0;m<=mm;m++)
                    {
                        if(flug==true)
                    {
                        break;
                    }
                    for (n=0;n<=nn;n++)
                        {
                            
                            if(S[0][0]==i+l && S[1][0]==j+l && S[2][0]==k+l && S[0][1]==i+m && S[1][1]==j+m && S[2][1]==k+m && S[0][2]==i+n && S[1][2]==j+n && S[2][2]==k+n)
                            {
                                cout<<"Yes"<<endl;
                                flug=true;
                                break;
                            
                                
                            }
                        }
                    }
                }
            }
        }
    }
    
    
    
    
    
    
    
    
    
    
    if(flug==false)
    {
        cout<<"No"<<endl;
    
    }
    
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

int max(int a, int b){
  return a >= b ? a : b;
}
int min(int a, int b){
  return b >= a ? a : b;
}
int sei(int a){
  return a>0 ? a : 0;
}
int factorial(int n) {
    if (n > 0) return n*factorial(n - 1);
		else return 1;
}
int compare_up_int(const void *a, const void *b){
   return *(int*)a - *(int*)b;
}
int compare_down_int(const void *a, const void *b){
   return *(int*)b - *(int*)a;
}
int euclid(int a, int b){
  if(a < b){int tmp = a;a = b;b = tmp;}
  int r = a % b;
  if(r < 0) r += b;
  while(r != 0){
    a = b;b = r;r = a % b;
    if(r < 0) r += b;
  }
  return b;
}

int main(){
  int n[3][3]={{0,0,0},{0,0,0},{0,0,0}},flag=0;
  int minx[3]={200,200,200};
  int miny[3]={200,200,200};
  for(int i=0;i<3;i++){
    for(int j=0;j<3;j++){
      scanf("%d ",&n[i][j]);
    }
  }
  for(int i=0;i<3;i++){
    for(int j=0;j<3;j++){
      minx[i]=min(n[i][j],minx[i]);
    }
  }

  for(int i=0;i<3;i++){
    for(int j=0;j<3;j++){
      miny[i]=min(n[j][i],miny[i]);
    }
  }
  //debug
  //for(int i=0;i<3;i++)printf("%d\n",minx[i]);
  //for(int i=0;i<3;i++)printf("%d\n",miny[i]);
for(int a=0;a<=minx[0];a++){
  for(int b=0;b<=minx[1];b++){
    for(int c=0;c<=minx[2];c++){
      for(int d=0;d<=miny[0];d++){
        for(int e=0;e<=miny[1];e++){
          for(int f=0;f<=miny[2];f++){
            if(n[0][0]==a+d && n[0][1]==a+e && n[0][2]==a+f && n[1][0]==b+d && n[1][1]==b+e && n[1][2]==b+f && n[2][0]==c+d && n[2][1]==c+e && n[2][2]==c+f){
              printf("Yes");
              return 0;
            }
          }
        }
      }
    }
  }
}
printf("No");
  return 0;
}
//  [c]
#include<stdio.h>
int main(){
  int c[3][3],i,j;
  for(i=0;i<3;i++)for(j=0;j<3;j++)scanf("%d",&c[i][j]);
  for(i=0;i<2;i++)if(c[0][i]-c[0][i+1]!=c[1][i]-c[1][i+1]||c[0][i]-c[0][i+1]!=c[2][i]-c[2][i+1]){printf("No");return 0;}
  for(i=0;i<2;i++)if(c[i][0]-c[i+1][0]!=c[i][1]-c[i+1][1]||c[i][0]-c[i+1][0]!=c[i][2]-c[i+1][2]){printf("No");return 0;}
  printf("Yes");
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(void) {
	int i, possibility;
	int m[3][3];
	int diff1, diff2;
	char buf[128], *ch;

	for(i = 0; i < 3; i += 1) {
		fgets(buf, sizeof(buf), stdin);
		ch = strtok(buf, " ");
		m[i][0] = atoi(ch);
		ch = strtok(NULL, " ");
		m[i][1] = atoi(ch);
		ch = strtok(NULL, " ");
		m[i][2] = atoi(ch);
	}

	diff1 = m[0][0] - m[1][0];
	diff2 = m[0][0] - m[2][0];

	possibility = 1;
	if(diff1 != m[0][1] - m[1][1] || diff1 != m[0][2] - m[1][2]) {
		possibility = 0;
	}
	if(diff2 != m[0][1] - m[2][1] || diff2 != m[0][2] - m[2][2]) {
		possibility = 0;
	}
	
	if(possibility == 1) {
		printf("Yes\n");
	} else {
		printf("No\n");
	}

	return 0;
}
//  [javascript]
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const c = arg.map(n=>n.split(" ").map(l=>parseInt(l)));
    
    // a1の仮定100通りを試す
    for(let a1=0; a1<=100; a1++) {
        // a1が決まればb1,b2,b3も決まる
        const b1 = c[0][0] - a1;
        const b2 = c[1][0] - a1;
        const b3 = c[2][0] - a1;
        
        // そうすると、他のaの値も全て確定するので正しいか検証する
        for(let a2=0; a2<=100; a2++) {
            if(a2 + b1 !== c[0][1]) continue;
            if(a2 + b2 !== c[1][1]) continue;
            if(a2 + b3 !== c[2][1]) continue;

            for(let a3=0; a3<=100; a3++) {
                if(a3 + b1 !== c[0][2]) continue;
                if(a3 + b2 !== c[1][2]) continue;
                if(a3 + b3 !== c[2][2]) continue;
                
                console.log("Yes");
                return;
            }
        }
    }
    
    console.log("No");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function Main(input) {
  input = input.split("\n");
  tmp1 = input[0].split(" ");
  tmp2 = input[1].split(" ");
  tmp3 = input[2].split(" ");
  c = new Array(3);
  c1= new Array(3).fill(0);
  c2= new Array(3).fill(0);
  c3= new Array(3).fill(0); 
  for(i=0;i<3;i++){
    c1[i]=parseInt(tmp1[i]);
    c2[i]=parseInt(tmp2[i]);
    c3[i]=parseInt(tmp3[i]);
  }
  c[0]=c1;
  c[1]=c2;
  c[2]=c3;
  var ans="No";
  if(c[2][2]-c[1][2]==c[2][1]-c[1][1]&&c[2][1]-c[1][1]==c[2][0]-c[1][0]&&
  c[1][2]-c[0][2]==c[1][1]-c[0][1]&&c[1][1]-c[0][1]==c[1][0]-c[0][0]&&
  c[0][2]-c[0][1]==c[1][2]-c[1][1]&&c[1][2]-c[1][1]==c[2][2]-c[2][1]&&
  c[0][1]-c[0][0]==c[1][1]-c[1][0]&&c[1][1]-c[1][0]==c[2][1]-c[2][0]){
    var ans="Yes";
  }
  console.log('%s', ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input){
  var arr = input.split('\n');
  var c = [];
  c.push(arr[0].split(' ').map(a=>Number(a)));
  c.push(arr[1].split(' ').map(a=>Number(a)));
  c.push(arr[2].split(' ').map(a=>Number(a)));

  if((c[0][1]-c[0][0]==c[1][1]-c[1][0])&&
  (c[0][1]-c[0][0]==c[2][1]-c[2][0])&&
  (c[0][2]-c[0][0]==c[1][2]-c[1][0])&&
  (c[0][2]-c[0][0]==c[2][2]-c[2][0])){
    console.log('Yes');
  }else{
    console.log('No');
  }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

const (
	initialBufSize = 10000
	maxBufSize     = 1000000009
)

var buf []byte = make([]byte, maxBufSize)
var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBufSize)
}

func main() {
	c := make([][]int, 3)
	for i, _ := range c {
		c[i] = make([]int, 3)
	}
	for i := 0; i < 3; i++ {
		for j := 0; j < 3; j++ {
			c[i][j] = nextInt()
		}
	}
	for i := 0; i <= 100; i++ {
		a := make([]int, 3)
		b := make([]int, 3)
		a[0] = i
		ok := true
		for j, _ := range c[0] {
			if c[0][j] >= i {
				b[j] = c[0][j] - i
			} else {
				ok = false
				break
			}
		}
		if ok != true {
			continue
		}
		a[1] = c[1][0] - b[0]
		for j, _ := range c[1] {
			if c[1][j]-b[j] != a[1] {
				ok = false
				break
			}
		}
		if ok != true {
			continue
		}
		a[2] = c[2][0] - b[0]
		for j, _ := range c[2] {
			if c[2][j]-b[j] != a[2] {
				ok = false
				break
			}
		}
		if ok != true {
			continue
		}
		fmt.Println("Yes")
		return
	}
	fmt.Println("No")
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
//  [ruby]
nums = []
3.times { nums << gets.split.map(&:to_i) }

res = false

101.times do |a_i|
  b_i = nums[0][0] - a_i
  b_j = nums[0][1] - a_i
  b_k = nums[0][2] - a_i
  101.times do |a_j|
    101.times do |a_k|
      as = [a_i, a_j, a_k]
      bs = [b_i, b_j, b_k]
      valid = true
      3.times do |a|
        3.times do |b|
          if nums[a][b] != as[a] + bs[b]
            valid = false
            break
          end
        end
      end
      if valid
        res = true
        break
      end
    end
  end
end
puts res ? "Yes" : "No"
//  [ruby]
c = []

3.times do
    c << gets.chomp.split(" ").map(&:to_i)
end

(0..100).each do |a1|
    (0..100).each do |a2|
        (0..100).each do |a3|
            flags = []
            3.times do |i|
                flag1 = c[i][0] - a1
                flag2 = c[i][1] - a2
                flag3 = c[i][2] - a3
                if flag1 == flag2 && flag2 == flag3 && flag3 == flag1 then
                    flags << true
                else
                    flags << false
                end
            end
            if flags.all?{|v| v} then
                puts "Yes"
                exit
            end
        end
    end
end

puts "No"
//  [ruby]
grids = Array.new(3, Array.new(3))

3.times do |i|
  grids[i] = STDIN.gets.split(' ').map(&:to_i)
end

correct = false

0.upto(100) do |a1|
  0.upto(100) do |a2|
    0.upto(100) do |a3|
      b1_1 = grids[0][0] - a1
      b1_2 = grids[1][0] - a2
      b1_3 = grids[2][0] - a3
      
      b2_1 = grids[0][1] - a1
      b2_2 = grids[1][1] - a2
      b2_3 = grids[2][1] - a3
      
      b3_1 = grids[0][2] - a1
      b3_2 = grids[1][2] - a2
      b3_3 = grids[2][2] - a3
      
      if ((b1_1 == b1_2 && b1_2 == b1_3) && 
        (b2_1 == b2_2 && b2_2 == b2_3) && 
        (b3_1 == b3_2 && b3_2 == b3_3))     
        correct = true
        break
      end
      
    end
  end
end

if correct
  puts 'Yes'
else
  puts 'No'
end
//  [rust]
#[allow(unused_imports)]
use std::io::{stdin, Read, StdinLock};
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::str::FromStr;
#[allow(unused_imports)]
use std::collections::{HashSet, HashMap, BinaryHeap, VecDeque};
#[allow(unused_imports)]
use std::vec::Vec;

#[allow(dead_code)]
const INF: i32 = 1000_000_000;
#[allow(dead_code)]
const INFLL: i64 = 1000_000_000_000_000_000;
#[allow(dead_code)]
const EPS: f64 = 1.0e-10;
#[allow(dead_code)]
const MOD: i32 = 1000_000_007;
#[allow(dead_code)]
const MODLL: i64 = 1000_000_007;

struct Scanner<'a> {
    cin: StdinLock<'a>,
}

#[allow(dead_code)]
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner {cin: cin}
    }
    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
                    .skip_while(|c| c.is_whitespace())
                    .take_while(|c| !c.is_whitespace())
                    .collect::<String>();
        token.parse::<T>().ok()
    }
    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }
}



fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let mut c: Vec<Vec<i32>> = vec![vec![0; 3]; 3];
    for i in 0..3 {
        for j in 0..3 {
            c[i][j] = sc.read();
        }
    }
    let mut ans = false;
    for a1 in -100..100i32 {
        for a2 in -100..100i32 {
            for a3 in -100..100i32 {
                let b: Vec<i32> = vec![c[0][0] - a1, c[0][1] - a1, c[0][2] - a1];
                let a: Vec<i32> = vec![a1, a2, a3];
                let mut t = true;
                for i in 0..3 {
                    for j in 0..3 {
                        if a[i] + b[j] != c[i][j] {
                            t = false;
                        }
                    }
                }
                ans |= t;
            }
        }
    }
    if ans {
        println!("Yes");
    } else {
        println!("No");
    }
}
//  [rust]
use std::io::*;

fn main() {
    let i = stdin();
    solve(&mut i.lock(), &mut stdout());
}

fn solve(i: &mut BufRead, o: &mut Write) {
    let mut c = Vec::new();
    for _ in 0..3 {
        c.push(read_nums(i));
    }
    let r1 = c[2][2] - c[2][0] - c[1][2] + c[1][0] == 0;
    let r2 = c[2][2] - c[2][0] - c[1][2] + c[1][1] - c[0][1] + c[0][0] == 0;
    let r3 = -c[2][1] + c[2][0] + c[0][1] - c[0][0] == 0;
    let r4 = -c[2][2] + c[2][0] + c[0][2] - c[0][0] == 0;
    let r = r1 && r2 && r3 && r4;

    /*
    eliminate(
    [
    a0 + b0 = c00,
    a1 + b0 = c10,
    a2 + b0 = c20,

    a0 + b1 = c01,
    a1 + b1 = c11,
    a2 + b1 = c21,

    a0 + b2 = c02,
    a1 + b2 = c12,
    a2 + b2 = c22,
    ],
    [a0,a1,a2,b0,b1,b2])
    */

    writeln!(o, "{}", if r { "Yes" } else { "No" }).unwrap();
}

fn read_line(i: &mut BufRead) -> String {
    let mut line = String::new();
    i.read_line(&mut line).unwrap();
    line.trim().to_string()
}
fn read_nums(i: &mut BufRead) -> Vec<isize> {
    read_line(i)
        .split(' ')
        .map(|x| x.parse().unwrap())
        .collect()
}
//  [python]
# coding: utf-8
import numpy

N = input()
N_list = list(N)
map(str,N_list)
N_list[3] = "8"

ans = ''.join(N_list)
print(ans)
//  [python]
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())
//  [python]
s= raw_input()
print '2018'+s[4:]
//  [java]
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
      Scanner in = new Scanner(System.in);

      String str = in.next();

      String str2 = str.substring(8,10);

      System.out.println("2018/01/"+str2);

  }


}
//  [java]
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String t = "";
    for(int i = 0; i < s.length(); i++) {
      if(i == 3) {
        t += "8";
      } else {
        t += String.valueOf(s.charAt(i));
      }
    }
    System.out.println(t);
  }
}
//  [java]
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		final Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String ans = "2018"+s.substring(4);
		System.out.println(ans);
	}
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll , ll> 			pll;
typedef pair<ld, ld> 			pld;
typedef unordered_map<ll, ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5 + 7;
const ll 	MAX7 	= 	1e+7 + 7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e+9 + 7;

vll adj[MAXN]; ll visit[MAXN] = {};
int dx8[] = {0, 1, 1, 1, 0, -1, -1, -1}, dy8[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dx4[] = {0, 1, 0, -1}, dy4[] = {1, 0, -1, 0};

// <------------- Declare Variables Here ------------> //

ll T = 1;
ll n, x, y, r, p;
string s, t;
// <------------- Implement Functions Here ----------> //



// <------------- Start of main() -------------------> //

void MAIN() {
	cin>>s;
	s[3] = '8';
	cout<<s;
}

int main() {
	fastio; randomINT;
	//cin>>t;
	while (T--) {
		MAIN();
	}
	return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000009
#define ll long long
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define set0(a) memset ((a), 0 , sizeof(a))
#define set1(a) memset((a),-1,sizeof (a))
#define pi pair<int, int>
#define ps pair<string, string>
#define pl pair<long, long>
#define pll pair<long long, long long>
#define vll vector<long long>
#define vl vector<long>
#define vi vector<int>
#define vs vector<string>
#define vps vector< ps >
#define vpi vector< pi >
#define vpl vector< pl >
#define vpll vector< pll >
#define flash  ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tc(t,T) for(long long t=0;t<T;t++)
#define rep(i,s,n,d) for(long long i=s;i<n;i=i+d)

bool sortbysec(const pll &a,
              const pll &b)
{
    return (a.second < b.second);
}
/*bool cxp pair<ll, pll> &a,
              const pair<ll, pll> &b)
{
    return (a.ff < b.ff);
}*/

void func(void)
{
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
}
ll gcd(ll a,ll b){
    if(b==0)return a;
    else return gcd(b,a%b);
}
void printStack(stack<string> s){
    if(s.empty())return;

    string x=s.top();
    s.pop();
    printStack(s);
    cout<<x;
    s.push(x);

}


ll binaryexp(ll n,ll p){

    if(p==0) return 1;
    if(p%2==0) return binaryexp((n%mod)*(n%mod),p/2);
    else return ((n%mod)*binaryexp(((n%mod)*(n%mod))%mod,(p-1)/2)%mod);

}

#define meax 10000001
vll spf(meax,0);
void siv(){
    spf[1]=1;

   for(ll i=2;i<meax;i++)spf[i]=i;

   for(ll i=4;i<meax;i+=2){
        spf[i]=2;
    }
    for(ll i=3;i*i<meax;i++){
        if(spf[i]==i){
            for(ll j=i*i;j<meax;j+=i){
                if(spf[j]==j){
                    spf[j]=i;
                }
            }
        }
    }
}


int main(){
    string s;
    cin>>s;
    s[3]='8';
    cout<<s<<endl;

}
//  [cpp]
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <bitset>
#include <sstream>
#include <cstdlib>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <climits>
#include <ctype.h>
using namespace std;

#define PI acos(-1.0)
#define EPS 1e-8
#define MOD 1000000007
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define fi first
#define se second

typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;

template <class L, class R> ostream &operator <<(ostream &os, pair<L, R> P){
    return os << "(" << P.fi << "," << P.se << ")";
}
template <class T> ostream &operator <<(ostream &os, vector<T> V){
    os << "["; for (auto vv: V) os << vv << ","; return os << "]";
}

struct Matrix {
    vvi data;
    int r, c;
    Matrix(int row, int col, bool identity = false) : r(row), c(col) {
        data.assign(row, vector<int>(col, 0));
        if (identity) {
            for (int i = 0; i < r; ++i) {
                data[i][i] = 1;
            }
        }
    }
    Matrix operator * (Matrix& other) {
        int m = r, n = c, p = other.c;
        Matrix res(m, p);
        for (int i = 0; i < m; ++i) {
            for (int j = 0; j < p; ++j) {
                for (int k = 0; k < n; ++k) {
                    res.data[i][j] += data[i][k] * other.data[k][j];
                }
            }
        }
        return res;
    }
};

// 扩展欧几里得算法 res[1] * a + res[2] * b = res[0] = gcd(a, b)
vector<int> extendGcd(int a, int b) {
    if (b == 0) {
        return {a, 1, 0};
    } else {
        vector<int> tmp = extendGcd(b, a % b);
        return {tmp[0], tmp[2], tmp[1] - (a / b) * tmp[2]};
    }
}

// 矩阵快速幂
Matrix matrix_power(Matrix base, ll exp) {
    int n = base.r;
    Matrix res(n, n, true);
    while (exp) {
        if (exp & 1) {
            res = res * base;
        }
        base = base * base;
        exp >>= 1;
    }
    return res;
}

// 带模快速幂
template <typename T>
T power_mod(T base, int exp, int mod = MOD) {
    T res = 1;
    while (exp) {
        if (exp & 1) res = res * base % mod;
        base = base * base % mod;
        exp >>= 1;
    }
    return res;
}

// 快速幂
template <typename T>
T power(T base, int exp) {
    T res = 1;
    while (exp) {
        if (exp & 1) res *= base;
        base *= base;
        exp >>= 1;
    }
    return res;
}

// 求逆元
ll inv(ll a) {
    return power_mod(a, MOD - 2);
}

/******************************** template ********************************/
#define N 200010
string s;

int main() {
    cin >> s;
    s[3] = '8';
    cout << s;

    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>

int main()
{
	char s[11];
	scanf("%s",&s);
	s[3]='8';
	printf("%s",s);
}