jiahuimbzuai/CoQuIR huggingface dataset:
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {n: isize,y: isize}
    for i in 0..=n {
        let mili = i * 10000;
        for j in i..=n {
            let thou = j * 5000;
            let k = n - i - j;
            if k < 0 {
                continue;
            }
            let hund = k * 1000;
            if y == mili + thou + hund {
                println!("{} {} {}", i, j, k);
                return;
            }
        }
    }
    println!("-1 -1 -1");
}
//  [rust]
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        n: usize,
        y: usize,
    }

    for i in 0..n+1 {
        for j in 0..n+1 {
            for k in 0..n+1 {
                if i+j+k==n && 10000*i+5000*j+1000*k==y {
                    print!("{} ",i);
                    print!("{} ",j);
                    println!("{}",k);
                    return;
                }
            }
        }
    }
    println!("-1 -1 -1");
}
//  [rust]
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        n: usize,
        y: usize,
    }

    for i in 0..y/10000+1 {
        if i>n {
            break;
        }
        for j in 0..y/5000+1 {
            if j>n {
                break;
            }
            for k in 0..y/1000+1 {
                if k>n {
                    break;
                }
                if i+j+k==n && 10000*i+5000*j+1000*k==y {
                    print!("{} ",i);
                    print!("{} ",j);
                    println!("{}",k);
                    return;
                }
            }
        }
    }
    println!("-1 -1 -1");
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let ints = readInts()
let n = ints[0]
let sum = ints[1]

func main() {
    for i in 0...n {
        for j in 0...(n - i) {
            let k = n - i - j
            if k < 0 {
                break
            }
            if i * 10_000 + j * 5_000 + k * 1_000 == sum && i + j + k == n {
                print(i, j , k)
                return
            }
        }
    }
    print("-1 -1 -1")
}

main()
//  [swift]
import Foundation
//10000x + 5000y + 1000z = Y
let rdInt = readLine()!.split(separator: " ").map({Int($0)!})
let N = rdInt[0]
let Y = rdInt[1]

var ansX = -1
var ansY = -1
var ansZ = -1

testlabel: for x in 0 ... N {
    for y in 0 ... N {
        let z = N-x-y
        if z < 0 {
            break
        }
            if 10000*x + 5000*y + 1000*z == Y {
                ansX = x
                ansY = y
                ansZ = N - x - y
                break testlabel
            }
    }
}
print(ansX,ansY,ansZ)
//  [swift]
import CoreFoundation
let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}
let n=arr[0]
let y=arr[1]
for i in 0...n {
	for j in 0...n-i {
		let k=n-i-j
		if i*1000+j*5000+k*10000==y {
			print(k,terminator:" ")
			print(j,terminator:" ")
			print(i)
			exit(0)
		}
	}
}
print("-1 -1 -1")
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let ints = readInts()
let n = ints[0]
let sum = ints[1]
var remain = sum

let (x, y, z) = (10_000, 5_000, 1_000)

func countAndReduceRemain(by paper: Int, remain: Int) -> (count: Int, remain: Int) {
    guard remain > paper else {
        return (0, remain)
    }
    let count = remain / paper
    return (count, remain - count * paper)
}

let first = countAndReduceRemain(by: x, remain: remain)
let second = countAndReduceRemain(by: y, remain: first.remain)
let final = countAndReduceRemain(by: z, remain: second.remain)

if first.count + second.count + first.count == n {
    print("\(first.count) \(second.count) \(final.count)")
} else {
    print("-1 -1 -1")
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let ints = readInts()
let n = ints[0]
let sum = ints[1]
var remain = sum

let (x, y, z) = (10_000, 5_000, 1_000)

func countAndReduceRemain(by paper: Int, remain: Int) -> (count: Int, remain: Int) {
    guard remain > paper else {
        return (0, remain)
    }
    let count = remain / paper
    return (count, remain - count * paper)
}

let first = countAndReduceRemain(by: x, remain: remain)
let second = countAndReduceRemain(by: y, remain: first.remain)
let final = countAndReduceRemain(by: z, remain: second.remain)

if first.count + second.count + first.count > 0 {
    print("\(first.count) \(second.count) \(final.count)")
} else {
    print("-1 -1 -1")
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let ints = readInts()
let n = ints[0]
let sum = ints[1]
var remain = sum

let (x, y, z) = (10_000, 5_000, 1_000)

func countAndReduceRemain(by paper: Int, remain: Int) -> (count: Int, remain: Int) {
    guard remain > paper else {
        return (0, remain)
    }
    let count = remain / paper
    return (count, remain - count * paper)
}

let first = countAndReduceRemain(by: x, remain: remain)
let second = countAndReduceRemain(by: y, remain: first.remain)
let final = countAndReduceRemain(by: z, remain: second.remain)

if first.count + second.count + first.count > 0 {
    print("\(first.count) \(second.count) \(first.count)")
} else {
    print("-1 -1 -1")
}
//  [typescript]
import * as fs from 'fs';
const DEBUG = false;
const input = fs.readFileSync("/dev/stdin", "utf8").trim();
// 処理
const [N, Y] = input.split(" ").map(v => parseInt(v));
let [x, y, z] = [-1, -1, -1];

const maxX = Math.floor(Y / 10000);
debuglog(maxX);
ST: for (let xi = maxX; xi >= 0; xi--) {
    for (let yi = N - xi; yi >= 0; yi--) {
        const zi = N - xi - yi;
        if (xi * 10000 + yi * 5000 + zi * 1000 === Y && xi + yi + zi === N) {
            x = xi; y = yi; z = zi;
            break ST;
        }
    }
}

console.log(`${x} ${y} ${z}`);
// テスト実行は`npm run test` -> 値input -> `ctrl+d`


function debuglog(n: any) {
    if (DEBUG) {
        console.log(n);
    }
}
//  [typescript]
import { Hash } from "crypto";

class Input {
    private lines: string[];
    constructor(lines: string[]) {
        this.lines = lines;
    }

    public readLine(): string { return this.lines.shift() as string; }
    public readLineInt(): number { return parseInt(this.readLine()); }
    public readLineIntArray(): number[] { return this.readLine().split(" ").map(n => parseInt(n)); }
    public readLineStringArray(): string[] { return this.readLine().split(" "); }

    public readAllLines(): string[] { return this.lines; }
    public readAllLinesInt(): number[] { return this.lines.map(s => parseInt(s)); }
    public readAllLinesIntArray(): number[][] { return this.lines.map(s => s.split(" ").map(n => parseInt(n))); }
    public readAllLinesStringArray(): string[][] { return this.lines.map(s => s.split(" ")); }
}

function calc(stdin: Input) {
    const first = stdin.readLineIntArray();
    const N = first[0];
    const Y = first[1] / 1000;

    for (let hideyo = 0; hideyo <= N; hideyo++) {
        for (let ichiyo = 0; ichiyo <= N - hideyo; ichiyo++) {
            const yukichi = N - hideyo - ichiyo;
            if (hideyo + ichiyo * 5 + yukichi * 10 == Y) {
                return `${yukichi} ${ichiyo} ${hideyo}`;
            }
        }
    }

    return "-1 -1 -1";
}

function main(stdin: string) {
    console.log(calc(new Input(stdin.split("\n"))));
}

if (require.main && require.main.filename.indexOf("Main") >= 0) {
    main(require('fs').readFileSync('/dev/stdin', 'utf8'));
} else {
    main(`
2000 20000000
`.trim());
}
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

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

const res = _ => {
  for (let i = 0; i <= n; i++) {
    for (let j = 0; j <= n - i; j++) {
      const total = i * 10000 + j * 5000 + (n - i - j) * 1000
      if (total === y) return `${i} ${j} ${n - i - j}`
    }
  }
  return '-1 -1 -1'
}

console.log(res())
//  [typescript]
const lines = [];
const reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});
reader.on("line", function (line) {
  lines.push(line);
});

reader.on("close", function () {
  const input = (lines[0] as string).split(" ");
  const num = Number(input[0]);
  const sum = Number(input[1]);

  if (sum / num <= 1000) {
    console.log(0, 0, sum / num);
    return;
  }

  const res = matchPatterns(num, sum);

  console.log(res[2], res[1], res[0]);
});

function matchPatterns(num: number, sum: number): number[] {
  for (let i = 0; i <= num; i++) {
    for (let j = 0; j <= num; j++) {
      for (let k = 0; k <= num; k++) {
        if (i + j + k === num) {
          const tmp = 1000 * i + 5000 * j + 10000 * k;
          if (tmp === sum) {
            return [i, j, k];
          }
        }
      }
    }
  }
  return [-1, -1, -1];
}
//  [typescript]
const lines = [];
const reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});
reader.on("line", function (line) {
  lines.push(line);
});

reader.on("close", function () {
  const input = (lines[0] as string).split(" ");
  const num = Number(input[0]);
  const sum = Number(input[1]);

  const res = matchPatterns(num, sum);

  console.log(res[2], res[1], res[0]);
});

function matchPatterns(num: number, sum: number): number[] {
  for (let i = 0; i <= num; i++) {
    for (let j = 0; j <= num; j++) {
      for (let k = 0; k <= num; k++) {
        if (i + j + k === num) {
          const tmp = 1000 * i + 5000 * j + 10000 * k;
          if (tmp === sum) {
            return [i, j, k];
          }
        }
      }
    }
  }
  return [-1, -1, -1];
}
//  [typescript]
function main(input: string) {
  const nums: number[] = input.split(' ').map(n => parseInt(n, 10))
  const N: number = nums[0]
  const Y: number = nums[1]
  const Z: number = Y / 1000

  if (Y % 1000 !== 0) {
    console.log('-1 -1 -1')
    return
  }
  else if (Y < 1000 * N) {
    console.log('-1 -1 -1')
    return
  } else {
    for (let i: number = 0; i < Z; i ++) {
      for (let j: number = 0; j < Z; j ++) {
        for (let k: number = 0; j < Z; k ++) {
          const bill: number = i + j + k
          const sum: number = i + 10000 + j * 5000 + 1000 * k
          if (bill === N && sum === Y) {
            console.log(i, j, k)
            return
          }
        }
      }
    }
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [python]
# -*- coding: utf-8 -*-

A = int(input())
B = int(input())

ans = 6 - A - B

print(ans)
//  [python]
a = int(input())
b = int(input())


print(list(set(range(1, 4)).difference(set([a, b])))[0])
//  [python]
print(6-(int(input())+int(input())))
//  [python]
def wtf(x):
    twos = 0
    fives = 0
    for j in range(1, 60):
        bs = 2 ** j
        twos = twos + x // bs
        bs = 2 * 5 ** j
        fives = fives + x // bs
    return min(twos, fives)
x = int(input())
print(wtf(x) if x % 2 == 0 else 0)
//  [python]
a = int(input())
b = int(input())

if (a == 1 and b == 2) or (a == 2 and b == 1) :
  print(3)
elif (a == 2 and b == 3) or (a == 3 or b == 2) :
  print(1)
else:
  pritn(2)
//  [python]
X = {1,2,3}
a = int(input())
b = int(input())
print(list(X-set(a)-set(b))[0])
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int a = Integer.parseInt(br.readLine());
		int b = Integer.parseInt(br.readLine());
		
		System.out.println(6-a-b);

	}

}
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
        public static void main(String[] args) throws Exception {
                BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                StringTokenizer st;
                PrintWriter pw = new PrintWriter(System.out);

                int a = Integer.parseInt(br.readLine());
                int b = Integer.parseInt(br.readLine());
                int x = 1^2^3;
                x^=a;
                x^=b;
                pw.println(x);


                pw.flush();
                pw.close();
        }
}
//  [java]
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.lang.Math;
import java.math.*;

public class Main {
    public static void main(String[] args) {
        FS reader = new FS();
        // write reader
        int A = reader.nextInt();
        int B = reader.nextInt();
        if (A*B==2) System.out.println(3);
        else if (A*B==3) System.out.println(2);
        else System.out.println(1);
    }

    // Read Class
    static class FS {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if (ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
    
        private int readByte() { return hasNextByte() ? buffer[ptr++] : -1;}
        private boolean isPrintableChar(int c) {return 33 <= c && c <= 126;}
        private void skipUnprintable() {while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
    
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public int nextInt() {
            return (int)nextLong();
        }
        public long nextLong() {
            if (!hasNext()) throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) {
                throw new NumberFormatException();
            }
            while(true) {
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                } else if(b == -1 || !isPrintableChar(b)) {
                    return minus ? -n : n;
                } else {
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }
    }
}
//  [java]



import java.util.Scanner;
	public class A {
	public static void main(String[] args) {
		nner(System.in);
			
			int a=sc.nextInt();
			int b=sc.nextInt(); 			
			int sum=a+b;			
			System.out.println(6-sum);
}
	
	}
//  [java]



import java.util.Scanner;
	public class A {
	public static void main(String[] args) {
		
		
			Scanner sc=new Scanner(System.in);			
			int a=sc.nextInt();
			int b=sc.nextInt(); 		
			int sum=a+b;			
			System.out.println(6-sum);
}
	
	}
//  [java]
import java.util.*;
class MyClass {
    public static void main(String args[]) {
        Scanner sc=new Scanner(System.in);
         int n=sc.nextInt();
         int a[]=new int[n];
         for(int i=0;i<n;i++)
         {
             a[i]=sc.nextInt();
         }
         int count=1,x=-1;
         for(int i=0;i<n;i++)
         {
             if(count==a[i])
             {
             count++;
             }
         }
         count=count-1;
         if(count==0)
         {
              System.out.println("-1");
         }
         else

      System.out.println(n-count);
    }
}
//  [cpp]
#include <stdio.h>
int main()
{
  int a, b;
  char S[4];
  scanf("%d", &a);
  scanf("%d", &b);
  if (a == 1 && b == 2)
    printf("3\n");
  else if (a == 1 && b == 3)
    printf("2\n");
  else if (a == 2 && b == 3)
    printf("1\n");
  else if (a == 2 && b == 1)
    printf("3\n");
  else if (a == 3 && b == 1)
    printf("2\n");
  else if (a == 3 && b == 2)
    printf("1\n");

  return 0;
}
//  [cpp]
#include<stdio.h>
int main()
{
	int a,b;
	scanf("%d%d",&a,&b);
	if(a+b==3)
		printf("3");
	else if(a+b==4)
		printf("2");
	else if(a+b==5)
		printf("1");
	return 0;
}
//  [cpp]
#include <stdio.h>
int main(void)
{
	int a,b,c;
	scanf("%d",&a);
	scanf("%d",&b);
	if(a==b){return -1;}
	if(a>3||a<1||b>3||b<1){return -1;}
	c=a+b;
	if(c==3){printf("3");}
	else if(c==4){printf("2");}
	else if(c==5){printf("1");}
	
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;

int main() {
	int a, b;
	cin >> a >> b;
	set<int> s;
	for (int i = 0; i < 3; i++) {
		s.insert(i);
	}
	s.erase(a);
	s.erase(b);
	cout << *s.begin();
	return 0;
}
//  [cpp]
#include <iostream>
using namespace std;
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

int main()
{
  fast_io;
  int a, b;
  cin >> a >> b;
  
  if (a == 1 && b == 2)
    cout << 3 << endl;
  else if (a == 1 && b == 3)
    cout << 2 << endl;
  else if (a == 2 && b == 3)
    cout << 1 << endl;
  
  return 0;
}
//  [cpp]
#include <bits/stdc++.h>
#define io ios_base::sync_with_stdio(0);cin.tie(0);
#define mod 1000000009
#define pi 2*acos(0)
#define ll long long
#define ii pair<int,int>
#define vi vector<int>
using namespace std;


int main()
{

	io;
	
	int a, b; cin >> a >> b;
	int arr[4] = { 0 };
	arr[a] = 1;
	arr[b] = 1;
	for (int i = 1; i <= 3; i++)
		if (!arr[i])
			cout << i;
}
//  [c]
#include<stdio.h>
int main()
{
	int a, b;
	scanf("%d %d", &a, &b);
	if (a != 1 && b != 1)printf("1\n");
	else if (a != 2 && b != 2)printf("2\n");
	else printf("3\n");
	return 0;
}
//  [c]
#include<stdio.h>

int main(void){
  int A, B;
  scanf("%d %d", &A, &B);
  if(A==1 || B==1){
	if(A==2 || B==2){ printf("3");}
    else{printf("2");}
  }
  else if(A==2 || B==2){
	if(A==1 || B==1){ printf("3");}
    else{printf("1");}
  }
  else if(A==3 || B==3){
	if(A==1 || B==1){ printf("2");}
    else{printf("1");}
  }
}
//  [c]
#include<stdio.h>
int main()
{
    int a[2]={0},n[3]={0},i;
    for(i=0;i<2;i++){
        scanf("%d",&a[i]);
    }
    for(i=0;i<2;i++){
        n[a[i]-1]=1;
    }
    for(i=0;i<3;i++){
        if(n[i]==0) printf("%d\n",i+1);
    }
    return 0;
}
//  [c]
int main()
{
  int A, B;
  scanf("%d %d", &A, &B);
  printf("%d\n", 6 - A - B);
  printf("The correct choice =");
  return 0;
}
//  [c]
#include <stdio.h>
int main(){
	int x,y,z;
	scanf("%d",&x);
	getchar();
	scanf("%d",&y);
	getchar();
	z=6-x-y;
	printf("%d",z);
	return 7;
}
//  [c]
#include<stdio.h>
int main(void){
  int A,B;
  scanf("%d",&A);
  scanf("%d",&B);
  if((A==1) AND (B==3) OR (A==3) AND (B==1)){
    printf("%d",2);
  }
  else if((A==1) AND (B==2) OR (A==2) AND (B==1)){
    printf("%d",3);
  }
  else
    printf("%d",1);
  return 0;
}
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
    "use strict";
	// 1行目がinput[0], 2行目がinput[1], …に入る
	const input_ = input.split("\n");
	//文字列から10進数に変換するときはparseIntを使います
	const A = parseInt(input_[0], 10);
    const B = parseInt(input_[1], 10);
    const choices = [1,2,3];
    const index = choices.findIndex(x => x!==A && x!== B);
    // 出力
	console.log('%d',choices[index]);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(arg) {
	arg = arg.trim().split('\n');
  	arg = arg.map(str => parseInt(str, 10));
  	var a = arg[0], b = arg[1];
  	if(a != 1 && b != 1) {
    	console.log('1');
    } else if (a != 2 && b != 2) {
    	console.log('2');
    } else if (a != 3 && b != 3) {
    	console.log('3');
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
    const d = [1,2,3].filter((v)=>{
     	return !input.includes(v);
    })
	//出力
	console.log('%d',d[0]);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
import java.util.Scanner;


public class _hanif_sir {

    
    public static void main(String[] args) {
         Scanner in =new Scanner(System.in);
       int a=in.nextInt();
       int b=in.nextInt();
       System.out.print(6-(a+b));
    }
    
}
//  [javascript]
const readline = require('readline').createInterface({
	  input: process.stdin,
	  output: process.stdout
})

readline.question('Insert A ', (input1) => {
	readline.question('Insert B ', (input2) => {
		console.log(6-Number(input1)-Number(input2))
		readline.close()
	});
});
//  [javascript]
let A = Number(prompt())
let B = Number(prompt())

console.log(6-A-B)
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)

	a := nextInt()
	b := nextInt()

	fmt.Println(6 - a - b)
}

// ---- readfunc
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}
//  [go]
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

func main() {
	sc.Split(bufio.ScanWords)
	A, B := getInt(), getInt()

	a := min(A, B)
	b := max(A, B)

	if a == 1 && b == 2 {
		out(3)
	} else if a == 1 && b == 3 {
		out(2)
	} else if a == 2 && b == 3 {
		out(1)
	}
}
//  [go]
package main

import "fmt"

func main() {
	var A, B int
	fmt.Scan(&A, &B)
	check := map[int]bool{
		1: false,
		2: false,
		3: false,
	}
	check[A] = true
	check[B] = true
	for k, v := range check {
		if !v {
			fmt.Println(k)
			return
		}
	}
}
//  [go]
package main

import "fmt"

func main() {
	var A, B int
	fmt.Scanf("%d", &A)
	fmt.Scanf("%d", &B)

	for i := 0; i < 3; i++ {
		if A == i || B == i {
			continue
		} else {
			fmt.Println(i)
		}
	}
}
//  [go]
package main
 
import("fmt")
 
func main(){
  var a,b int
  fmt.Scanf("%d %d",&a, &b)
  c:=6-a-b
  fmt.Printf("%d",c)
}
//  [go]
package main

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

var sc *bufio.Scanner = func() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return sc
}()

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func nextInts(n int) []int {
	ints := make([]int, n)
	for i := 0; i < n; i++ {
		ints[i] = nextInt()
	}
	return ints
}

func breakBrick(bricks []int) (brokenCount int, isSuccess bool) {
	bi := 1
	for _, v := range bricks {
		if bi == v {
			bi++
			continue
		}
		brokenCount++
	}
	if len(bricks) != brokenCount {
		isSuccess = true
	}
	return
}

func main() {
	n := nextInt()
	ints := nextInts(n)
	bc, ok := breakBrick(ints)
	if ok {
		fmt.Println(bc)
	} else {
		fmt.Println(-1)
	}
}
//  [ruby]
A, B = gets.chomp, gets
puts "123".delete(A).delete(B)
//  [ruby]
arr = [1,2,3]
a = gets.to_i
b = gets.to_i

arr.delete(a)
arr.delete(b)

puts arr[0]
//  [ruby]
puts [1,2,3]-[gets.to_i, gets.to_i]
//  [ruby]
puts(6 - gets.chomp.split.map(&:to_i).sum)
//  [ruby]
a=gets.chomp.to_i
b=gets.chomp.to_i

puts [1,2,3].push(a).push(b).uniq[0]
//  [ruby]
a=gets.chomp.to_i
b=gets.chomp.to_i

puts [1,2,3].delete(a).delete(b)[0]
//  [rust]
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("failed 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 a:usize = read();
    let b:usize = read();
    let mut arr = vec![1, 2, 3];
    arr.retain(|&x| x != a);
    arr.retain(|&x| x != b);
    println!("{}", arr[0]);
}
//  [rust]
fn main() {
    let a = read::<usize>();
    let b = read::<usize>();

    let ret: usize;
    if a == 1 && b == 2 {
        ret = 3;
    } else if a == 1 && b == 3 {
        ret = 2;
    } else if a == 2 && b == 1 {
        ret = 3;
    } else if a == 2 && b == 3 {
        ret = 1;
    } else if a == 3 && b == 1 {
        ret = 2;
    } else {
        ret = 1;
    }

    println!("{}", ret);
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().parse().ok().unwrap()
}
//  [rust]
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("failed 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 a: u32 = read();
    let b: u32 = read();

    println!("{}", 6 - a - b);
}
//  [rust]
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("failed 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 a:usize = read();
    let b:usize = read();
    let mut arr = vec![1, 2, 3];
    arr.remove(a-1);
    arr.remove(b-1);
    println!("{}", arr[0]);
}
//  [rust]
fn main() {
    let a: u8 = {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        s.trim_end().to_owned().parse().unwrap()
    };

    let b: u8 = {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        s.trim_end().to_owned().parse().unwrap()
    };

    println!("{}", 6 - a - b);
}
//  [swift]
let a = readLine()!
let b = readLine()!
let sentaku = ["1","2", "3"]
let indexNoa = sentaku.index(of: a)
let indexNob = sentaku.index(of: b)
if a != b {
print(4-indexNoa!-indexNob!)
}
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let a = Int(readLine()!)!
    let b = Int(readLine()!)!
    
    if a != 1 && b != 1 {
        print(1)
        return
    }
    if a != 2 && b != 2 {
        print(2)
        return
    }
    if a != 3 && b != 3 {
        print(3)
        return
    }
}

main()
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
 
let num=readInts()
let num2=readInts()
print(6-num[0]-num2[0])
//  [swift]
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
    
let st = readInts()
let s = st[0]
let t = st[1]
print(t+s)
//  [swift]
let a=Int(readLine()!)!
let b=Int(readLine()!)!
for i in 1...3{
  if (a!=i)&&(b!=i){
    print(i)
  }
}
//  [swift]

import Foundation

func main(){
   let line = readLine()!.split(separator: " ")
   
   let a = Int(line[0])!
   let b = Int(line[1])!
   
   var answer: Int = 0
   var multiplier1 = 1
   let multiplier2 = max(a, b)
   let multiplier3 = min(a, b)
   while answer == 0 {
      if multiplier2 * multiplier1 % multiplier3 == 0 {
         answer = multiplier2 * multiplier1
      }
      multiplier1 += 1
   }
   
   print(answer)}
main()
//  [typescript]
import * as fs from 'fs';

//in
// 3
// 1
//out
// 2
function main(inp: string) {

    const [a, b]: number[] = inp.split('\n').map(Number);
    // 1 2  3
    // 2 1  3
    // 1 3  2
    // 3 1  2
    // 2 3  1
    // 3 2  1
    console.log(6 - (a + b));
}

main(fs.readFileSync('/dev/stdin', 'utf8').trim());
//  [typescript]
export class Main {
  static main(input: string): string {
    const tmp: string[] = input.split("\n");
    const a: number = parseInt(tmp.shift().split(" ")[0]);
    const b: number = parseInt(tmp.shift().split(" ")[0]);
    return `${[1, 2, 3].filter(i => i != a && i != b)[0]}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [typescript]
function Main(input) {
	const lines = input.split('\n');
	const [a, b] = lines;

	console.log(['1', '2', '3'].filter(v => v !== a && v !== b)[0]);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
import * as fs from 'fs';

const input = fs.readFileSync("/dev/stdin", "utf8").split("/n");
const a = +input[0];
const b = +input[1];

console.log(6-a-b);
//  [typescript]
import * as fs from 'fs';

const input = fs.readFileSync("/dev/stdin", "utf8").split(" ");
const a = +input[0];
const b = +input[1];

console.log(6-a-b);
//  [typescript]
import * as fs from 'fs';

const input = fs.readFileSync("/dev/stdin", "utf8").split("\n");

const a = +input[0]
const b = +input[1]

console.log(input)

if (a + b == 3) {
  console.log(3)
} else if (a + b == 4) {
  console.log(2)
} else {
  console.log(1)
}
//  [python]

# じょえチャンネルおもしろいよ～～～
# https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ

s=input()
if s[2]==s[3] and s[4]==s[5]:print("Yes")
else:print("No")
//  [python]
n = str(input())

if n[2] == n[3] and n[4] == n[5]:
    print('Yes')
else:
    print('No')
//  [python]
S = input()

if S[2]==S[3] and S[4]==S[5]:
    print('Yes')
else:
    print('No')
//  [python]
s = input()
if(s[2] == s[3] && s[4] == s[5]):
    print("Yes")
else:
    print("No")
//  [python]
s = list(input())
if s[2] == s[3]:
    if s[4] == s[5]:
        print("Yes")
else:
    print("No")
//  [python]
s = str(input())
if s[2] == s[3]:
    if s[4] == s[5]:
        print("Yes")
else:
    print("No")
//  [java]
import java.io.*;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    char[] s = br.readLine().toCharArray();
    if (s[2] == s[3] && s[4] == s[5]){
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
}
//  [java]
/*
 *created by Kraken on 28-03-2020 at 17:05
 */
import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) {
		FastReader sc = new FastReader();
		String s = sc.next();
		if (s.charAt(2) == s.charAt(3) && s.charAt(4) == s.charAt(5))
			System.out.println("Yes");
		else
			System.out.println("No");
	}

	static class FastReader {

		BufferedReader br;

		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				}
				catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

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

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

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			}
			catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}
//  [java]
import java.util.*;
import java.io.*;
import java.lang.*;
public class Main{

     public static void main(String []args) throws Exception {
        BufferedReader inp = new BufferedReader(new InputStreamReader(System.in));
        String s = inp.readLine().trim();
        int len = s.length();
        if(len==0 || len>6){
            System.out.println("No");
        }else{
            if(s.charAt(2) == s.charAt(3)  && s.charAt(4)==s.charAt(5)){
                System.out.println("Yes");
            }else{
                System.out.println("No");
            }
        }
        
        
     }
}
//  [java]
import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine().trim();
		//System.out.println(s);
		
		if((s.charAt(2)==s.charAt(3)) && (s.charAt(4)==s.charAt(5)))
		    System.out.println("YES");
		else
		    System.out.println("NO");
	}
}
//  [java]
import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine().trim();
		//System.out.println(s);
		
		if((s.charAt(2)==s.charAt(3)) && (s.charAt(4)==s.charAt(5)))
		    System.out.println("YES");
		else
		    System.out.println("NO");
	}
}
//  [java]
/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String s=br.readLine().trim();
		//System.out.println(s);
		
		if((s.charAt(2)==s.charAt(3)) && (s.charAt(4)==s.charAt(5)))
		    System.out.println("YES");
		else
		    System.out.println("NO");
	}
}
//  [cpp]
#include <stdio.h>

int main(){
  char S[6];
  scanf("%s",S);
  if(S[2]==S[3] && S[4]==S[5]){
  	printf("Yes\n");
  }else{
  	printf("No\n");
  }
}
//  [cpp]
#include <stdio.h>

int main(void){
  int i;
  char s[6];
  for(i=0; i<6; i++){
    scanf("%c", &s[i]);
  }
  if(s[2]==s[3] && s[4]==s[5]){
    printf("Yes\n");
  }else{
    printf("No\n");
  }
  return 0;
}
//  [cpp]
#include<stdio.h>
int main(void)
{
	int CHECK = 0;
 	char S[7];
	scanf("%s",S);
 	if((S[2] == S[3]) &&(S[4] == S[5]))
      CHECK = 1;
  	if(CHECK == 1)
      printf("Yes");
  	else
      printf("No");
}
//  [cpp]
#include<stdio.h>

int main(){
	char a[10];
	scanf("%s", &a)
	
	if(a[2]==a[3] && a[4]==a[5]){
		puts("Yes");
	}
	else
	puts("No");
	return0;
}
//  [cpp]
#include<iostream>
#include<string>

int main(){
  string s;
  cin >> s;
  if(s[2] == s[3] && s[4] == s[5]) cout << "Yes" <<endl;
  else cout << "No" <<endl;
  return 0;
}
//  [cpp]
#include<iostream> #include<string> int main(){string s; cin >> s; if(s[2]  == s[3] && s[4] == s[5] {cout << "Yes" <<endl;} else {cout << "No" <<endl;} return 0;}
//  [c]
#include <stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void){
		char a[6];
    scanf("%s",a);
    if(a[2]==a[3]&&a[4]==a[5]){
      printf("Yes\n");
    }
    else{
      puts("No");
    }


		return 0;
}
//  [c]
#include <stdio.h>
int main() {
  char char_arr[100];
  scanf("%s", char_arr);
  if(char_arr[2]==char_arr[3] && char_arr[4]==char_arr[5]){
     printf("Yes\n");
  }else{
      printf("No\n");
    }
  return 0;
}
//  [c]
#include <stdio.h>

int	main(void)
{
	char str[7];
	scanf("%s",str);
	if (str[2]==str[3]&&str[4]==str[5])
	{
		printf("Yes\n");
		return(0);
	}
	printf("No\n");
	return(0);

}
//  [c]
#include <stdio.h>
int main (){
	int a, b, i;
	scanf("%d %d", &a, &b);
	for(i=a;i<=b;i++){
		if (i%2!=0){
			i+=2;
			printf("%d ", i);
		}
		else if (a%2==0){
			i+=1;
			printf("%d ", i);
		}
	}
	return 0;
}
//  [c]
#include <stdio.h>
int main (){
	char kata[6];
	scanf("%s", kata);
	if (kata[2] == kata[3] && kata[4] == kata[5]){
		printf("Yes");
	}
	else {
		printf("No");
	}
	return 0;
}
//  [c]
#include <stdio.h>
int main (){
	char kata[6];
	scanf("%s", kata);
	if (kata[2] != kata[3] && kata[4] != kata[5]){
		printf("No");
	}
	else {
		printf("Yes");
	}
	return 0;
}
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
	//文字列から10進数に変換するときはparseIntを使います
	var s = input[0];
  
  var ans = "No";
  if(s[2] == s[3] && s[4] == s[5]) ans = "Yes";

	//出力
	console.log('%s', ans);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
	if(input[2]===input[3] && input[4] ===input[5]){console.log("Yes");}
  else{console.log("No");}
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input){
  if(input[2] === input[3] && input[4] === input[5]){
    console.log("Yes");
  }else{
    console.log("No");
  }
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
const main = stdin => {
  const S = stdin.trim()
  if (S[2] === S[3] && S[3] === S[4]) {
    console.log('Yes')
  } else {
    console.log('No')
  }
}

// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
//  [javascript]
function main(input) {
  const inputs = input.split('\n')
  const [S] = inputs[0].split(' ')
  console.log(S[2] === S[3] && S[4] === S[5] ?
   'Yes' : 'No'
  )

}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(n) {
    if (n > 499) {
        let _n = Math.floor(n / 500);
        let _n2 = n % 500;
        let _n3 = Math.floor(_n2 % 5);
        console.log((_n * 1000) + (_n3 * 5));
    } else {
        console.log(Math.floor(n / 5) * 5);
    }
}
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)

	s := nextStr()

	if s[2] == s[3] && s[4] == s[5] {
		fmt.Println("Yes")
		return
	}
	fmt.Println("No")

}

// ---- readfunc
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var S string
	fmt.Scan(&S)

	if S[2] == S[3] && S[4] == S[5] {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}
//  [go]
package main

import (
  "fmt"
)


func main() {
  var s string 
  fmt.Scan(&s)
  ans := "No"
  if s[2] == s[3] && s[4] == s[5] {
    ans = "Yes"
  }
  fmt.Println(ans)
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var s string
	fmt.Scan(&s)

	if s[2] == s[3] && s[4] == s[6] {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}
//  [go]
/**
 * 最短経路の練習
 *
 */

package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	N, X, Y := nextInt(sc), nextInt(sc), nextInt(sc)
	
	// コスト計算「Warshall-Floyd法」
	// エッジのコストは可変でも行けるはず...
	// 参考：https://qiita.com/ta-ka/items/a023a11efe17ab097433#warshall-floyd%E6%B3%95
	distance := make([][]int, N)
	for k := 0; k < N; k++ {
		for i := 0; i < N; i++ {
			if k == 0 {
				distance[i] = make([]int, N)
				if i == (X-1) {
					distance[i][Y-1] = 1
				} else if i == (Y-1) {
					distance[i][X-1] = 1
				}
				if i > 0 {
					distance[i][i-1] = 1
				}
				if i < N-1 {
					distance[i][i+1] = 1
				}
			}
			for j := 0; j < N; j++ {
				if k == 0 {
					isSetedDistance := false
					isSetedDistance = isSetedDistance || i == j
					isSetedDistance = isSetedDistance || i == (X - 1) && j == (Y - 1)
					isSetedDistance = isSetedDistance || j == (X - 1) && i == (Y - 1)
					isSetedDistance = isSetedDistance || i == (j + 1) || i == (j - 1)
					isSetedDistance = isSetedDistance || j == (i + 1) || j == (i - 1)
					if !isSetedDistance {	
						distance[i][j] = N - 1
					}
				}
				if i > j {
					distance[i][j] = min(distance[i][j], distance[i][k] + distance[k][j])
					distance[j][i] = distance[i][j]
				} else {
					break
				}
			}
		}
	}
	
	// カウント
	count := make([]int, N-1)
	for i := 0; i < N; i++ {
		for j := 0; j < N; j++ {
			if i > j {
				count[distance[i][j]-1] += 1
			} else {
				break
			}
		}
	}
	
	// 表示
	for _, num := range count {
		fmt.Println(num)
	}

}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	t, _ := strconv.Atoi(sc.Text())
	return t
}
//  [go]
/*
 * Golangの練習
 *
 */

package main

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

var rdr = bufio.NewReaderSize(os.Stdin, 10000000000)

func readLine() string {
    buf := make([]byte, 0, 10000000000)
    for {
        l, p, e := rdr.ReadLine()
        if e != nil {
            panic(e)
        }
        buf = append(buf, l...)
        if !p {
            break
        }
    }
    return string(buf)
}

func main(){
	var splitedLine []string

	// 1行目
	splitedLine = strings.Split(readLine(), " ")
	k, _ := strconv.Atoi(splitedLine[0])
	n, _ := strconv.Atoi(splitedLine[1])
	
	// 2行目
	var a = make([]int, n+1)
	splitedLine = strings.Split(readLine(), " ")
	for i, s := range splitedLine {
		val, _ := strconv.Atoi(s)
		a[i] = val
	}
	a[n] = k+a[0]

	// NOTE: REの原因個所の特定
	maxCost := 0
	for i := 0; i < n; i++ {
		tmp := a[i+1] - a[i]
		if tmp > maxCost {
			maxCost = tmp
		}
	}
	fmt.Println(k - maxCost)
}
//  [ruby]
s = gets.chomp

if s[2] == s[3] && s[4] == s[5]
  puts "Yes"
else
  puts "No"
end
//  [ruby]
s = gets.chomp
string = s.split("")
if string[2] == string[3] && string[4] == string[5]
  puts 'Yes'
else puts 'No'
end
//  [ruby]
S = gets.chomp              # 文字列。chompを付けないと改行文字がついてくる
S.freeze
wk = S.split("")

if wk[2].gsub(" ", "") == wk[3].gsub(" ", "") && wk[4].gsub(" ", "") == wk[5].gsub(" ", "") then
  puts "Yes"
else
  puts "No"
end
//  [ruby]
s = gets
if s[2]==s[3] && s[4]==s[5]
  put :Yes
else
  puts :No
end
//  [ruby]

s = gets.chomp.split('')

if(s[2] == s[3] || s[4] == s[5])
	puts "Yes"
else
	puts "No"
end
//  [ruby]
S = gets.length?('6') ? "YES" : "NO"
//  [rust]
use std::io;

fn main() {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let s:Vec<char> = buf.trim().chars().collect();
	if s[2] == s[3] && s[4] == s[5] {
		println!("Yes");
	}else{
		println!("No");
	}
}
//  [rust]
fn main() {
    let s = read::<String>();
    let v: Vec<char> = s.chars().into_iter().collect();
    if v[2] == v[3] && v[4] == v[5] {
        println!("Yes");
    } else {
        println!("No");
    }
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().parse().ok().unwrap()
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        s: String,
    }

    solve(s);
}

fn solve(s: String) {
    let mut s = s.chars();
    if s.nth(2) == s.nth(3) && s.nth(4) == s.nth(5) {
        println!("Yes");
    } else {
        println!("No");
    }
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    let mut s: String;
    input! {s: String};

    let s3 = &s[2..3];
    let s4 = &s[3..4];
    let s5 = &s[4..5];
    let s6 = &s[5..6];

    if s3 == s4 || s5 == s6 {
        println!("Yes")
    } else {
        println!("No")
    }
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        s: String,
    }

    let c: Vec<_> = s.chars().collect();

    if c.get(2) == c.get(3) && c.get(2) == c.get(3) {
        println!("Yes");
    } else {
        println!("No");
    }

}
//  [swift]
import Foundation
let sArray = (readLine()!).characters.flatMap { String($0) }

print(sArray[2] == sArray[3] && sArray[4] == sArray[5] ? "Yes" : "No")
//  [swift]
import Foundation

func readInts() -> [Int]{
    readLine()!.split(separator: " ").map { Int($0)! }
}

func main(){
    let aryS = readLine()!.map { String($0) }
    print(aryS[2] == aryS[3] && aryS[4] == aryS[5] ? "Yes": "No")
}
main()
//  [swift]
func main() {
    let s = Array(readLine()!)
    if s[2] == s[3] && s[4] == s[5] {
        print("Yes")
    } else {
        print("No")
    }
}

main()
//  [swift]
import Foundation
 
let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ")
 
let S = split[0]

let A = S.prefix(2)
let B = S.prefix(3)
let C = S.prefix(4)
let D = S.prefix(5)

if (A==B && C==D){
    print("Yes")
}else{
    print("No")
}
//  [swift]
import Foundation
 
let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ")
 
let S = split[0]

let A = S.prefix(3)
let B = S.prefix(4)
let C = S.prefix(5)
let D = S.prefix(6)

if (A==B && C==D){
    print("Yes")
}else{
    print("No")
}
//  [swift]
import Foundation

func readInts() -> [Int]{
    readLine()!.split(separator: " ").map { Int($0)! }
}

func main(){
    let aryS = readLine()
    print(aryS[2] == aryS[3] && aryS[4] == aryS[5]? "Yea": "No")
}
main()
//  [typescript]
function main(input) {
    const lines = input.split("\n");
    const S = lines[0];
    
    console.log((S[2] == S[3] && S[4] == S[5])? 'Yes' : 'No');
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
function Main(input: string) {
  const lines: string[] = input.split("\n");

  const s = lines[0];
  
  const msg = (s[2] === s[3] && s[4] === s[5])? 'Yes' : 'No';
  
  console.log(msg);
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
const main = (input: string) => {
  const strList = input.split('');
  console.log((strList[2] === strList[3] && strList[4] === strList[5] ? 'Yes' : 'No'));
}

// *この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
// inputに入力データ全体が入る
function Main(input) {
  const lines = input.split('\n');
  const k = parseInt(lines[0].split(' ')[0]);
  const a = lines[1].split(' ').map(parseInt);
  
  let mx = n - a[a.length - 1] + a[0];
  let sum = mx;
  for(let i = 0; i < a.length - 1; i++) {
  	const b = a[i + 1] - a[i];
    mx += b;
    if(mx < b) {
      mx = b;
    }
  }
  
  console.log(sum - mx);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import deque

n,m = map(int,readline().split())
data = list(map(int,read().split()))
it = iter(data)

links = [[] for _ in range(n+1)]
for a,b in zip(it,it):
    links[a].append(b)
    links[b].append(a)

d = deque()
d.append(1)
parent = [-1] * (n+1)
parent[1] = 0

while(d):
    i = d.popleft()
    for j in links[i]:
        if(parent[j] == -1):
            parent[j] = i
            d.append(j)

ans = parent[2:]
if(min(ans) == -1):
    print('No')
else:
    print('Yes')
    print('\n'.join(map(str,ans)))
//  [python]
from collections import deque
import sys


readline = sys.stdin.readline
readall = sys.stdin.read
ins = lambda: readline().rstrip()
ini = lambda: int(readline().rstrip())
inm = lambda: map(int, readline().split())
inl = lambda: list(map(int, readline().split()))
prl = lambda x: print(*x ,sep='\n')


n,m = inm()
W = [[] for _ in range(n)]
for _ in range(m):
    a,b = inm()
    W[a-1].append(b-1)
    W[b-1].append(a-1)

res = [0] * n
dis = [n] * n
dis[0] = 0

q = deque()
q.append(0)
while q:
    c = q.popleft()
    for i in W[c]:
        if dis[i] > dis[c] + 1:
            dis[i] = dis[c] + 1
            res[i] = c + 1
            q.append(i)

print('Yes')
prl(res[1:])