#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(dead_code)]

#[allow(unused_macros)]
macro_rules! invec {
    ( $ t : ty ) => {{
        let mut s = String::new();
        match std::io::stdin().read_line(&mut s) {
            Ok(0) => Vec::<$t>::new(),
            Ok(n) => s
                .trim()
                .split_whitespace()
                .map(|s| s.parse::<$t>().unwrap())
                .collect::<Vec<$t>>(),
            Err(_) => Vec::<$t>::new(),
        }
    }};
}

#[allow(unused_macros)]
macro_rules! get {
      ($t:ty) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              line.trim().parse::<$t>().unwrap()
          }
      };
      ($($t:ty),*) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              let mut iter = line.split_whitespace();
              (
                  $(iter.next().unwrap().parse::<$t>().unwrap(),)*
              )
          }
      };
      ($t:ty; $n:expr) => {
          (0..$n).map(|_|
              get!($t)
          ).collect::<Vec<_>>()
      };
      ($($t:ty),*; $n:expr) => {
          (0..$n).map(|_|
              get!($($t),*)
          ).collect::<Vec<_>>()
      };
      ($t:ty ;;) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              line.split_whitespace()
                  .map(|t| t.parse::<$t>().unwrap())
                  .collect::<Vec<_>>()
          }
      };
      ($t:ty ;; $n:expr) => {
          (0..$n).map(|_| get!($t ;;)).collect::<Vec<_>>()
      };
}

#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [$t:tt]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
#[cfg(debug_assertions)]
macro_rules! mydbg {
    //($arg:expr) => (dbg!($arg))
    //($arg:expr) => (println!("{:?}",$arg));
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
      }
}
#[cfg(not(debug_assertions))]
macro_rules! mydbg {
    ($($arg:expr),*) => {};
}

macro_rules! echo {
    ($($a:expr),*) => {
          $(println!("{}",$a))*
      }
}

struct SliceDisplay<'a, T: 'a>(&'a [T]);
impl<'a, T: std::fmt::Display + 'a> std::fmt::Display for SliceDisplay<'a, T> {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        for item in self.0 {
            write!(f, "{} ", item)?;
        }
        Ok(())
    }
}

use std::cmp::*;
use std::collections::*;
use std::ops::{Add, Div, Mul, Sub};

#[allow(dead_code)]
static INF_I64: i64 = 92233720368547758;
#[allow(dead_code)]
static INF_I32: i32 = 21474836;
#[allow(dead_code)]
static INF_USIZE: usize = 18446744073709551;
#[allow(dead_code)]
static M_O_D: usize = 1000000007;
#[allow(dead_code)]
static PAI: f64 = 3.1415926535897932;

trait IteratorExt: Iterator {
    fn toVec(self) -> Vec<Self::Item>;
}

impl<T: Iterator> IteratorExt for T {
    fn toVec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

trait CharExt {
    fn toNum(&self) -> usize;
    fn toAlphabetIndex(&self) -> usize;
    fn toNumIndex(&self) -> usize;
}
impl CharExt for char {
    fn toNum(&self) -> usize {
        return *self as usize;
    }
    fn toAlphabetIndex(&self) -> usize {
        return self.toNum() - 'a' as usize;
    }
    fn toNumIndex(&self) -> usize {
        return self.toNum() - '0' as usize;
    }
}

trait VectorExt {
    fn joinToString(&self, s: &str) -> String;
}
impl<T: ToString> VectorExt for Vec<T> {
    fn joinToString(&self, s: &str) -> String {
        return self
            .iter()
            .map(|x| x.to_string())
            .collect::<Vec<_>>()
            .join(s);
    }
}

trait UsizeExt {
    fn pow(&self, n: usize) -> usize;
}
impl UsizeExt for usize {
    fn pow(&self, n: usize) -> usize {
        return ((*self as u64).pow(n as u32)) as usize;
    }
}

fn main() {
    input! {
       n: usize,
       y:usize,
    }

    for i in (0..(y / 10000) + 1).rev() {
        let a = y - (i * 10000);
        for j in (0..(a / 5000) + 1).rev() {
            let b = a - j * 5000;
            let c = b / 1000;
            //mydbg!(i, j, c);
            if i + j + c == n {
                echo!(i, j, c);
                return;
            } else if i + j + c > n {
                break;
            }
        }
    }
    echo!(-1, -1, -1);
}


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

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

#[allow(dead_code)]
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

fn calc(rest: u32, n: u32, satun: usize, satuv: &Vec<u32>, ans: (u32, u32, u32)) -> Option<(u32, u32, u32)> {
    let satu = satuv[satun];

    if satun == satuv.len() - 1 {
        if rest == satu * n {
            return Some((ans.0, ans.1, n));
        } else {
            return None;
        }
    }

    if rest > satu * n {
        return None
    }

    let rem = rest / satu;
    for i in (0..rem+1).rev() {
        if satu * i > rest || i > n { continue; }
        let ans_next = if satun == 0 { (i, ans.1, ans.2) } else { (ans.0, i, ans.2) };
        match calc(rest - satu * i, n - i, satun + 1, satuv, ans_next) {
            None => continue,
            Some(a) => return Some(a),
        }
    }

    None
}

fn main() {
    let v = read_vec::<u32>();
    let n: u32 = v[0];
    let y: u32 = v[1];

    let satuv = vec![10000, 5000, 1000];

    match calc(y, n, 0, &satuv, (0, 0, 0)) {
        None => println!("-1 -1 -1"),
        Some((i, j, k)) => println!("{} {} {}", i, j, k),
    }
}


#![allow(unused_mut)]
#![allow(non_snake_case)]
#![allow(unused_variables)]
#![allow(unused_imports)]
#![allow(unused_macros)]
#![allow(dead_code)]
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

macro_rules! max {
    ($x: expr) => ($x);
    ($x: expr, $($y: expr),+) => {
        cmp::max($x, max!($($y),+))
    };
}

macro_rules! min {
    ($x: expr) => ($x);
    ($x: expr, $($y: expr),+) => {
        cmp::min($x, min!($($y),+))
    };
}

const MOD: usize = 1_000_000_007;
const MAX: usize = 510_000;

struct BinCoeff {
    fac: Vec<usize>,
    finv: Vec<usize>,
    inv: Vec<usize>,
}

impl BinCoeff {
    fn new() -> BinCoeff {
        let fac = vec![0; MAX];
        let finv = vec![0; MAX];
        let inv = vec![0; MAX];
        let mut bincoeff = BinCoeff { fac: fac, finv: finv, inv: inv };
        bincoeff.com_init();
        bincoeff
    }

    fn com_init(&mut self) {
        let fac = &mut self.fac;
        let finv = &mut self.finv;
        let inv = &mut self.inv;
        fac[0] = 1;
        fac[1] = 1;
        finv[0] = 1;
        finv[1] = 1;
        inv[1] = 1;
        for i in 2..MAX {
            fac[i] = fac[i - 1] * i % MOD;
            inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
            finv[i] = finv[i - 1] * inv[i] % MOD;
        }
    }

    fn bin_coeff(&mut self, n: usize, k: usize) -> usize {
        if k > n/2 {
            self.bin_coeff(n-k, k)
        } else {
            self.fac[n] * (self.finv[k] * self.finv[n - k] % MOD) % MOD
        }
    }
}

// must input n <= m
fn gcd(n: usize, m: usize) -> usize {
    if n == 0 {
        m
    } else {
        gcd(m%n, n)
    }
}

use std::cmp;
use std::collections::{HashSet, BinaryHeap, VecDeque, HashMap};
use std::iter;
fn main() {
    input! {
        N: usize,
        Y: usize,
    }
    let max = Y / 1000;
    if max < N { return println!("-1 -1 -1") }
    let diff = max - N;
    for b in 0 .. diff/9+1 {
        if (diff - 9*b) % 4 == 0 {
            let c = (diff - 9*b) / 4;
            if b+c > N { continue }
            println!("{} {} {}", b, c, N-b-c);
            return
        }
    }
    println!("-1 -1 -1")

}


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");
}


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");
}


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");
}


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()


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)


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")


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")
}


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")
}


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")
}


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);
    }
}


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());
}


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())


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];
}


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];
}


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'))


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

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

ans = 6 - A - B

print(ans)


a = int(input())
b = int(input())

print(list(set(range(1, 4)).difference(set([a, b])))[0])


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)


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)


X = {1,2,3}
a = int(input())
b = int(input())
print(list(X-set(a)-set(b))[0])


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);

	}

}


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();
        }
}


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();
            }
        }
    }
}


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);
}

	}


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);
}

	}


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);
    }
}


#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;
}


#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;
}


#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;
}


#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;
}


#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;
}


#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;
}


#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;
}


#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");}
  }
}


#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;
}


int main()
{
  int A, B;
  scanf("%d %d", &A, &B);
  printf("%d\n", 6 - A - B);
  printf("The correct choice =");
  return 0;
}


#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;
}


#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;
}


// 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"));


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'));


// 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"));


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));
    }

}


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()
	});
});


let A = Number(prompt())
let B = Number(prompt())

console.log(6-A-B)


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()
}


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)
	}
}


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
		}
	}
}


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)
		}
	}
}


package main

import("fmt")

func main(){
  var a,b int
  fmt.Scanf("%d %d",&a, &b)
  c:=6-a-b
  fmt.Printf("%d",c)
}


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)
	}
}


A, B = gets.chomp, gets
puts "123".delete(A).delete(B)


arr = [1,2,3]
a = gets.to_i
b = gets.to_i

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

puts arr[0]


puts [1,2,3]-[gets.to_i, gets.to_i]


puts(6 - gets.chomp.split.map(&:to_i).sum)


a=gets.chomp.to_i
b=gets.chomp.to_i

puts [1,2,3].push(a).push(b).uniq[0]


a=gets.chomp.to_i
b=gets.chomp.to_i

puts [1,2,3].delete(a).delete(b)[0]


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]);
}


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()
}


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);
}


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]);
}


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);
}


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!)
}


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()


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

let num=readInts()
let num2=readInts()
print(6-num[0]-num2[0])


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

let st = readInts()
let s = st[0]
let t = st[1]
print(t+s)


let a=Int(readLine()!)!
let b=Int(readLine()!)!
for i in 1...3{
  if (a!=i)&&(b!=i){
    print(i)
  }
}


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()


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());


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")));


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"));


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);


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);


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)
}


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

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


n = str(input())

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


S = input()

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


s = input()
if(s[2] == s[3] && s[4] == s[5]):
    print("Yes")
else:
    print("No")


s = list(input())
if s[2] == s[3]:
    if s[4] == s[5]:
        print("Yes")
else:
    print("No")


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


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");
    }
  }
}


/*
 *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;
		}
	}
}


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");
            }
        }

     }
}


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");
	}
}


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");
	}
}


/* 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");
	}
}


#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");
  }
}


#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;
}


#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");
}


#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;
}


#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;
}


#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;}


#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;
}


#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;
}


#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);

}


#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;
}


#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;
}


#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;
}


// 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"));


// 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"));


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"));


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"))


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"));


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'));


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()
}


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")
	}
}


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)
}


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")
	}
}


/**
 * 最短経路の練習
 *
 */

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
}


/*
 * 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)
}


s = gets.chomp

if s[2] == s[3] && s[4] == s[5]
  puts "Yes"
else
  puts "No"
end


s = gets.chomp
string = s.split("")
if string[2] == string[3] && string[4] == string[5]
  puts 'Yes'
else puts 'No'
end


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


s = gets
if s[2]==s[3] && s[4]==s[5]
  put :Yes
else
  puts :No
end


s = gets.chomp.split('')

if(s[2] == s[3] || s[4] == s[5])
	puts "Yes"
else
	puts "No"
end


S = gets.length?('6') ? "YES" : "NO"


#[allow(unused_macros, dead_code)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros, dead_code)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros, dead_code)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(dead_code)]
struct UnionFind {
    parent: Vec<usize>,
    rank: Vec<usize>,
    size: Vec<usize>,
}

#[allow(dead_code)]
impl UnionFind {
    fn new(n: usize) -> UnionFind {
        let mut p = vec![0; n];
        for i in 0..n {
            p[i] = i;
        }
        return UnionFind {
            parent: p,
            rank: vec![0; n],
            size: vec![1; n],
        };
    }

    fn find(&mut self, x: usize) -> usize {
        if x == self.parent[x] {
            x
        } else {
            let p = self.parent[x];
            let pr = self.find(p);
            self.parent[x] = pr;
            pr
        }
    }

    fn same(&mut self, a: usize, b: usize) -> bool {
        self.find(a) == self.find(b)
    }

    fn unite(&mut self, a: usize, b: usize) {
        let a_root = self.find(a);
        let b_root = self.find(b);
        if self.rank[a_root] > self.rank[b_root] {
            self.parent[b_root] = a_root;
            self.size[a_root] += self.size[b_root];
        } else {
            self.parent[a_root] = b_root;
            self.size[b_root] += self.size[a_root];
            if self.rank[a_root] == self.rank[b_root] {
                self.rank[b_root] += 1;
            }
        }
    }

    fn get_size(&mut self, x: usize) -> usize {
        let root = self.find(x);
        self.size[root]
    }
}

const MOD_P: usize = 1000000007;

#[allow(dead_code)]
// fact(n) = n! mod p
fn fact(n: usize) -> usize {
    let mut acc = 1;
    for i in 1..n + 1 {
        acc = acc * i % MOD_P;
    }
    acc
}

#[allow(dead_code)]
fn mod_pow(b: usize, mut e: usize) -> usize {
    let mut base = b;
    let mut acc = 1;

    while e > 1 {
        if e % 2 == 1 {
            acc = acc * base % MOD_P;
        }
        e /= 2;
        base = base * base % MOD_P;
    }

    if e == 1 {
        acc = acc * base % MOD_P;
    }

    acc
}

#[allow(dead_code)]
fn comb(n: usize, r: usize) -> usize {
    // nCr = n! / (r! (n-r)!) = n! (r!)^(p-2) ((n-r)!)^(p-2)
    fact(n) * mod_pow(fact(r), MOD_P - 2) % MOD_P * mod_pow(fact(n - r), MOD_P - 2) % MOD_P
}

#[allow(dead_code)]
fn gcd(a: usize, b: usize) -> usize {
    if b > a {
        gcd(b, a)
    } else if a % b == 0 {
        b
    } else {
        gcd(b, a % b)
    }
}

#[allow(dead_code)]
fn getline() -> String {
    let mut __ret = String::new();
    std::io::stdin().read_line(&mut __ret).ok();
    return __ret;
}

use std::cmp::{max, min};

fn main() {
    input! {
        s: chars,
    }
    let ans = if s[2] == s[3] && s[4] == s[5] {
        "Yes"
    } else {
        "No"
    };
    println!("{}", ans);
}


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");
	}
}


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()
}


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");
    }
}


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")
    }
}


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");
    }

}


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

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


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()


func main() {
    let s = Array(readLine()!)
    if s[2] == s[3] && s[4] == s[5] {
        print("Yes")
    } else {
        print("No")
    }
}

main()


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")
}


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")
}


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()


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"));


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'));


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"));


// 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"));


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)))


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:])


#!/usr/bin/env python3

import sys
sys.setrecursionlimit(300000)

YES = "Yes"  # type: str

def solve(N: int, M: int, A: "List[int]", B: "List[int]"):
    conns = [[] for _ in range(N)]
    for i in range(M):
        conns[A[i] - 1].append(B[i] - 1)
        conns[B[i] - 1].append(A[i] - 1)

    q = [0]
    ret = [-1] * N
    visited = [False] * N
    visited[0] = True
    while True:
        nex = []
        for i in q:
            for con in conns[i]:
                if not visited[con]:
                    nex.append(con)
                    ret[con] = i
                    visited[con] = True
        if len(nex) == 0:
            break
        q = nex
    for r in ret[1:]:
        if r < 0:
            print('No')
            return
    print('Yes')
    for r in ret[1:]:
        print(r + 1)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [int()] * (M)  # type: "List[int]"
    B = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        A[i] = int(next(tokens))
        B[i] = int(next(tokens))
    solve(N, M, A, B)

if __name__ == '__main__':
    main()


from collections import deque
N, M = map(int, input().split())
route = [[] for _ in range(N)]
for _ in range(M):
  A, B = map(int, input().split())
  route[A-1].append(B-1)
  route[B-1].append(A-1)

tmp = 0
prv = 0
visited = [False]*N
kouho = deque()
ans = [-1]*(N)

for room in route[0]:
  kouho.append([room,0])
while kouho:
  visited[tmp] = True
  ans[tmp] = prv
  for room in route[tmp]:
    if not visited[room]:
      kouho.append([room,tmp])
  while kouho:
    tmp_ = kouho.popleft()
    tmp = tmp_[0]
    prv = tmp_[1]
    if not visited[tmp]:
      break
if -1 not in ans:
  print("Yes")
  for n in range(1,N):
    print(ans[n]+1)
else:
  print("No")


from collections import deque
N, M = map(int, input().split())
route = [[] for _ in range(N)]
for _ in range(M):
  A, B = map(int, input().split())
  route[A-1].append(B-1)
  route[B-1].append(A-1)

tmp = 0
prv = 0
visited = [False]*N
kouho = deque()
ans = [-1]*(N)

for room in route[0]:
  kouho.append([room,0])
while kouho:
  visited[tmp] = True
  ans[tmp] = prv
  for room in route[tmp]:
    if not visited[room]:
      kouho.append([room,tmp])
  while kouho:
    tmp_ = kouho.popleft()
    tmp = tmp_[0]
    prv = tmp_[1]
    if not visited[tmp]:
      break
print("Yes")
for n in range(1,N):
  print(ans[n]+1)


from collections import deque
N, M = map(int, input().split())
route = [[] for _ in range(N)]
for _ in range(M):
  A, B = map(int, input().split())
  route[A-1].append(B-1)
  route[B-1].append(A-1)

tmp = 0
prv = 0
visited = [False]*N
kouho = deque()
ans = [-1]*(N)

for room in route[0]:
  kouho.append([room,0])
while kouho:
  visited[tmp] = True
  ans[tmp] = prv
  for room in route[tmp]:
    if not visited[room]:
      kouho.append([room,tmp])
  while kouho:
    tmp_ = kouho.popleft()
    tmp = tmp_[0]
    prv = tmp_[1]
    if not visited[tmp]:
      break
print("Yes")
for n in range(1,N):
  print(ans[n])


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.OutputStreamWriter;
import java.util.LinkedList;
import java.util.NoSuchElementException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Iterator;
import java.io.BufferedWriter;
import java.util.Collection;
import java.io.IOException;
import java.io.Writer;
import java.util.Queue;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        DDoubleDots solver = new DDoubleDots();
        solver.solve(1, in, out);
        out.close();
    }

    static class DDoubleDots {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt(), m = in.readInt();
            Graph graph = new BidirectionalGraph(n, m);
            for (int i = 0; i < m; ++i) {
                int u = in.readInt() - 1;
                int v = in.readInt() - 1;
                graph.addSimpleEdge(u, v);
            }
            Queue<Integer> queue = new LinkedList<>();
            queue.add(0);
            int parent[] = new int[n];
            parent[0] = 0;
            Arrays.fill(parent, -1);
            while (!queue.isEmpty()) {
                int u = queue.poll();
                for (int nx = graph.firstOutbound(u); nx != -1; nx = graph.nextOutbound(nx)) {
                    int v = graph.destination(nx);
                    if (parent[v] != -1) continue;
                    parent[v] = u + 1;
                    queue.add(v);
                }
            }
            if (ArrayUtils.minElement(parent) == -1)
                out.printLine("No");
            else {
                out.printLine("Yes");
                for (int i = 1; i < n; ++i)
                    out.printLine(parent[i]);
            }

        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class BidirectionalGraph extends Graph {
        public int[] transposedEdge;

        public BidirectionalGraph(int vertexCount) {
            this(vertexCount, vertexCount);
        }

        public BidirectionalGraph(int vertexCount, int edgeCapacity) {
            super(vertexCount, 2 * edgeCapacity);
            transposedEdge = new int[2 * edgeCapacity];
        }

        public int addEdge(int fromID, int toID, long weight, long capacity, int reverseEdge) {
            int lastEdgeCount = edgeCount;
            super.addEdge(fromID, toID, weight, capacity, reverseEdge);
            super.addEdge(toID, fromID, weight, capacity, reverseEdge == -1 ? -1 : reverseEdge + 1);
            this.transposedEdge[lastEdgeCount] = lastEdgeCount + 1;
            this.transposedEdge[lastEdgeCount + 1] = lastEdgeCount;
            return lastEdgeCount;
        }

        protected int entriesPerEdge() {
            return 2;
        }

        protected void ensureEdgeCapacity(int size) {
            if (size > edgeCapacity()) {
                super.ensureEdgeCapacity(size);
                transposedEdge = resize(transposedEdge, edgeCapacity());
            }
        }

    }

    static interface IntReversableCollection extends IntCollection {
    }

    static interface Edge {
    }

    static class ArrayUtils {
        public static int minElement(int[] array) {
            return new IntArray(array).min();
        }

    }

    static interface IntIterator {
        public int value() throws NoSuchElementException;

        public boolean advance();

        public boolean isValid();

    }

    static interface IntList extends IntReversableCollection {
        public abstract int get(int index);

        public abstract void removeAt(int index);

        default public IntIterator intIterator() {
            return new IntIterator() {
                private int at;
                private boolean removed;

                public int value() {
                    if (removed) {
                        throw new IllegalStateException();
                    }
                    return get(at);
                }

                public boolean advance() {
                    at++;
                    removed = false;
                    return isValid();
                }

                public boolean isValid() {
                    return !removed && at < size();
                }

                public void remove() {
                    removeAt(at);
                    at--;
                    removed = true;
                }
            };
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

        public void printLine(int i) {
            writer.println(i);
        }

    }

    static class IntArray extends IntAbstractStream implements IntList {
        private int[] data;

        public IntArray(int[] arr) {
            data = arr;
        }

        public int size() {
            return data.length;
        }

        public int get(int at) {
            return data[at];
        }

        public void removeAt(int index) {
            throw new UnsupportedOperationException();
        }

    }

    static interface IntStream extends Iterable<Integer>, Comparable<IntStream> {
        public IntIterator intIterator();

        default public Iterator<Integer> iterator() {
            return new Iterator<Integer>() {
                private IntIterator it = intIterator();

                public boolean hasNext() {
                    return it.isValid();
                }

                public Integer next() {
                    int result = it.value();
                    it.advance();
                    return result;
                }
            };
        }

        default public int compareTo(IntStream c) {
            IntIterator it = intIterator();
            IntIterator jt = c.intIterator();
            while (it.isValid() && jt.isValid()) {
                int i = it.value();
                int j = jt.value();
                if (i < j) {
                    return -1;
                } else if (i > j) {
                    return 1;
                }
                it.advance();
                jt.advance();
            }
            if (it.isValid()) {
                return 1;
            }
            if (jt.isValid()) {
                return -1;
            }
            return 0;
        }

        default public int min() {
            int result = Integer.MAX_VALUE;
            for (IntIterator it = intIterator(); it.isValid(); it.advance()) {
                int current = it.value();
                if (current < result) {
                    result = current;
                }
            }
            return result;
        }

    }

    static interface IntCollection extends IntStream {
        public int size();

    }

    static class Graph {
        public static final int REMOVED_BIT = 0;
        protected int vertexCount;
        protected int edgeCount;
        private int[] firstOutbound;
        private int[] firstInbound;
        private Edge[] edges;
        private int[] nextInbound;
        private int[] nextOutbound;
        private int[] from;
        private int[] to;
        private long[] weight;
        public long[] capacity;
        private int[] reverseEdge;
        private int[] flags;

        public Graph(int vertexCount) {
            this(vertexCount, vertexCount);
        }

        public Graph(int vertexCount, int edgeCapacity) {
            this.vertexCount = vertexCount;
            firstOutbound = new int[vertexCount];
            Arrays.fill(firstOutbound, -1);

            from = new int[edgeCapacity];
            to = new int[edgeCapacity];
            nextOutbound = new int[edgeCapacity];
            flags = new int[edgeCapacity];
        }

        public int addEdge(int fromID, int toID, long weight, long capacity, int reverseEdge) {
            ensureEdgeCapacity(edgeCount + 1);
            if (firstOutbound[fromID] != -1) {
                nextOutbound[edgeCount] = firstOutbound[fromID];
            } else {
                nextOutbound[edgeCount] = -1;
            }
            firstOutbound[fromID] = edgeCount;
            if (firstInbound != null) {
                if (firstInbound[toID] != -1) {
                    nextInbound[edgeCount] = firstInbound[toID];
                } else {
                    nextInbound[edgeCount] = -1;
                }
                firstInbound[toID] = edgeCount;
            }
            this.from[edgeCount] = fromID;
            this.to[edgeCount] = toID;
            if (capacity != 0) {
                if (this.capacity == null) {
                    this.capacity = new long[from.length];
                }
                this.capacity[edgeCount] = capacity;
            }
            if (weight != 0) {
                if (this.weight == null) {
                    this.weight = new long[from.length];
                }
                this.weight[edgeCount] = weight;
            }
            if (reverseEdge != -1) {
                if (this.reverseEdge == null) {
                    this.reverseEdge = new int[from.length];
                    Arrays.fill(this.reverseEdge, 0, edgeCount, -1);
                }
                this.reverseEdge[edgeCount] = reverseEdge;
            }
            if (edges != null) {
                edges[edgeCount] = createEdge(edgeCount);
            }
            return edgeCount++;
        }

        protected final GraphEdge createEdge(int id) {
            return new GraphEdge(id);
        }

        public final int addFlowWeightedEdge(int from, int to, long weight, long capacity) {
            if (capacity == 0) {
                return addEdge(from, to, weight, 0, -1);
            } else {
                int lastEdgeCount = edgeCount;
                addEdge(to, from, -weight, 0, lastEdgeCount + entriesPerEdge());
                return addEdge(from, to, weight, capacity, lastEdgeCount);
            }
        }

        protected int entriesPerEdge() {
            return 1;
        }

        public final int addWeightedEdge(int from, int to, long weight) {
            return addFlowWeightedEdge(from, to, weight, 0);
        }

        public final int addSimpleEdge(int from, int to) {
            return addWeightedEdge(from, to, 0);
        }

        protected final int edgeCapacity() {
            return from.length;
        }

        public final int firstOutbound(int vertex) {
            int id = firstOutbound[vertex];
            while (id != -1 && isRemoved(id)) {
                id = nextOutbound[id];
            }
            return id;
        }

        public final int nextOutbound(int id) {
            id = nextOutbound[id];
            while (id != -1 && isRemoved(id)) {
                id = nextOutbound[id];
            }
            return id;
        }

        public final int destination(int id) {
            return to[id];
        }

        public final boolean flag(int id, int bit) {
            return (flags[id] >> bit & 1) != 0;
        }

        public final boolean isRemoved(int id) {
            return flag(id, REMOVED_BIT);
        }

        protected void ensureEdgeCapacity(int size) {
            if (from.length < size) {
                int newSize = Math.max(size, 2 * from.length);
                if (edges != null) {
                    edges = resize(edges, newSize);
                }
                from = resize(from, newSize);
                to = resize(to, newSize);
                nextOutbound = resize(nextOutbound, newSize);
                if (nextInbound != null) {
                    nextInbound = resize(nextInbound, newSize);
                }
                if (weight != null) {
                    weight = resize(weight, newSize);
                }
                if (capacity != null) {
                    capacity = resize(capacity, newSize);
                }
                if (reverseEdge != null) {
                    reverseEdge = resize(reverseEdge, newSize);
                }
                flags = resize(flags, newSize);
            }
        }

        protected final int[] resize(int[] array, int size) {
            int[] newArray = new int[size];
            System.arraycopy(array, 0, newArray, 0, array.length);
            return newArray;
        }

        private long[] resize(long[] array, int size) {
            long[] newArray = new long[size];
            System.arraycopy(array, 0, newArray, 0, array.length);
            return newArray;
        }

        private Edge[] resize(Edge[] array, int size) {
            Edge[] newArray = new Edge[size];
            System.arraycopy(array, 0, newArray, 0, array.length);
            return newArray;
        }

        protected class GraphEdge implements Edge {
            protected int id;

            protected GraphEdge(int id) {
                this.id = id;
            }

        }

    }

    static abstract class IntAbstractStream implements IntStream {
        public String toString() {
            StringBuilder builder = new StringBuilder();
            boolean first = true;
            for (IntIterator it = intIterator(); it.isValid(); it.advance()) {
                if (first) {
                    first = false;
                } else {
                    builder.append(' ');
                }
                builder.append(it.value());
            }
            return builder.toString();
        }

        public boolean equals(Object o) {
            if (!(o instanceof IntStream)) {
                return false;
            }
            IntStream c = (IntStream) o;
            IntIterator it = intIterator();
            IntIterator jt = c.intIterator();
            while (it.isValid() && jt.isValid()) {
                if (it.value() != jt.value()) {
                    return false;
                }
                it.advance();
                jt.advance();
            }
            return !it.isValid() && !jt.isValid();
        }

        public int hashCode() {
            int result = 0;
            for (IntIterator it = intIterator(); it.isValid(); it.advance()) {
                result *= 31;
                result += it.value();
            }
            return result;
        }

    }
}


import java.util.*;
import java.io.*;
public class Main {
    static List<Integer> [] al;

    public static void main(String [] args) throws IOException{
        FastScanner sc=new FastScanner();
        int n=sc.nextInt();
        int m=sc.nextInt();
        al=new ArrayList[n];
        for(int i=0;i<n;i++)al[i]=new ArrayList<>();
        for(int i=0;i<m;i++){
            int u=sc.nextInt()-1;
            int v=sc.nextInt()-1;
            al[u].add(v);
            al[v].add(u);
        }

        Queue<Integer> q=new LinkedList<>();
        boolean [] vis=new boolean[n];
        int [] level=new int[n];
        q.add(0);
        vis[0]=true;
        while(!q.isEmpty()){
            int u=q.poll();
            for(int v : al[u]){
                if(!vis[v]){
                    vis[v]=true;
                    q.add(v);
                    level[v]=u+1;
                }
            }
        }

        for(int i=0;i<n;i++){
            if(!vis[i]){
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
        StringBuilder sb=new StringBuilder("");
        for(int i=1;i<n;i++)sb.append(level[i]+"\n");
        System.out.println(sb.toString().trim());

    }

}

class FastScanner{
    private int BUFFER_SIZE = 1 << 16;

   private  DataInputStream din;

   private  byte[] buffer;

   private int bufferPointer, bytesRead;

   public FastScanner() {
       din = new DataInputStream(System.in);
       buffer = new byte[BUFFER_SIZE];
       bufferPointer = bytesRead = 0;
   }

   public FastScanner( String file_name) throws IOException {
       din = new DataInputStream(new FileInputStream(file_name));
       buffer = new byte[BUFFER_SIZE];
       bufferPointer = bytesRead = 0;
   }

   public String readLine() throws IOException {
        byte[] buf = new byte[64];
       int cnt = 0, c;
       while ((c = read()) != -1) {
           if (c == '\n')
               break;
           buf[cnt++] = (byte) c;
       }
       return new String(buf, 0, cnt);
   }

   public String next() throws IOException{

       byte c = read();
       while(Character.isWhitespace(c)){
           c = read();
       }

        StringBuilder builder = new StringBuilder();
       builder.append((char)c);
       c = read();
       while(!Character.isWhitespace(c)){
           builder.append((char)c);
           c = read();
       }

       return builder.toString();
   }

   public int nextInt() throws IOException {
       int ret = 0;
       byte c = read();
       while (c <= ' ')
           c = read();
        boolean neg = (c == '-');
       if (neg)
           c = read();
       do {
           ret = ret * 10 + c - '0';
       } while ((c = read()) >= '0' && c <= '9');

       if (neg)
           return -ret;
       return ret;
   }

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

   public long nextLong() throws IOException {
       long ret = 0;
       byte c = read();
       while (c <= ' ')
           c = read();
        boolean neg = (c == '-');
       if (neg)
           c = read();
       do {
           ret = ret * 10 + c - '0';
       } while ((c = read()) >= '0' && c <= '9');
       if (neg)
           return -ret;
       return ret;
   }

   public long[] nextLongArray( int n) throws IOException {
        long arr[] = new long[n];
       for(int i = 0; i < n; i++){
           arr[i] = nextLong();
       }
       return arr;
   }

   public char nextChar() throws IOException{
       byte c = read();
       while(Character.isWhitespace(c)){
           c = read();
       }
       return (char) c;
   }

   public double nextDouble() throws IOException {
       double ret = 0, div = 1;
       byte c = read();
       while (c <= ' ')
           c = read();
        boolean neg = (c == '-');
       if (neg)
           c = read();

       do {
           ret = ret * 10 + c - '0';
       } while ((c = read()) >= '0' && c <= '9');

       if (c == '.') {
           while ((c = read()) >= '0' && c <= '9') {
               ret += (c - '0') / (div *= 10);
           }
       }

       if (neg)
           return -ret;
       return ret;
   }

   public double[] nextDoubleArray( int n) throws IOException {
        double arr[] = new double[n];
       for(int i = 0; i < n; i++){
           arr[i] = nextDouble();
       }
       return arr;
   }

   private void fillBuffer() throws IOException {
       bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
       if (bytesRead == -1)
           buffer[0] = -1;
   }

   private byte read() throws IOException {
       if (bufferPointer == bytesRead)
           fillBuffer();
       return buffer[bufferPointer++];
   }

   public void close() throws IOException {
       if (din == null)
           return;
       din.close();
   }

}


import java.io.*;
import java.math.BigInteger;
import java.util.*;

// written by luchy0120

public class Main {
    public static void main(String[] args) throws Exception {

        new Main().run();
    }

    void solve() {
        int n = ni();
        int m = ni();

        List g[] = new ArrayList[n+1];

        for(int i=1;i<=n;++i){
            g[i] = new ArrayList();
        }

        for(int i=0;i<m;++i){
            int a = ni();
            int b = ni();
            g[a].add(b);
            g[b].add(a);
        }

        int q[]  =new int[1000000];
        int e = 0 ;int s = 0;
        q[e++] = 1;

        boolean vis[]  = new boolean[n+1];
        vis[1] = true;
        int back[] = new int[n+1];
        int ct =1;
        while(s<e){
            int c = q[s++];

            for(Object gg: g[c]){
                int go  = (int) gg;

                if(!vis[go]){
                    vis[go] = true;
                    back[go] = c;
                    q[e++] = go;
                    ct++;
                }
            }

        }
        if(ct==n){
            println("Yes");
            for(int i=2;i<=n;++i){
                println(back[i]);
            }
        }else{
            println("No");
        }

    }

    double dis(long x,long y,long a,long b){
        long v = (x-a)*(x-a)+(y-b)*(y-b);
        return Math.sqrt(v);
    }

    InputStream is;
    PrintWriter out;

    void run() throws Exception {
        //is = new FileInputStream(new File("C:\\Users\\Luqi\\Downloads\\P3387_9.in"));
        is = System.in;
        out = new PrintWriter(System.out);

        solve();
        out.flush();
    }

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte() {
        if (lenbuf == -1) throw new InputMismatchException();
        if (ptrbuf >= lenbuf) {
            ptrbuf = 0;
            try {
                lenbuf = is.read(inbuf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (lenbuf <= 0) return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) {
        return !(c >= 33 && c <= 126);
    }

    private int skip() {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
        return b;
    }

    private double nd() {
        return Double.parseDouble(ns());
    }

    private char nc() {
        return (char) skip();
    }

    private char ncc() {
        int b = readByte();
        return (char) b;
    }

    private String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while (p < n && !(isSpaceChar(b))) {
            buf[p++] = (char) b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private String nline() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!isSpaceChar(b) || b == ' ') {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[][] nm(int n, int m) {
        char[][] a = new char[n][];
        for (int i = 0; i < n; i++) a[i] = ns(m);
        return a;
    }

    private int[] na(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = ni();
        return a;
    }

    private long[] nal(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) a[i] = nl();
        return a;
    }

    private int ni() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) {
        }
        ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') num = (num << 3) + (num << 1) + (b - '0');
            else return minus ? -num : num;
            b = readByte();
        }
    }

    private long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) {
        }
        ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') num = num * 10 + (b - '0');
            else return minus ? -num : num;
            b = readByte();
        }
    }

    void print(Object obj) {
        out.print(obj);
    }

    void println(Object obj) {
        out.println(obj);
    }

    void println() {
        out.println();
    }

    void printArray(int a[],int from){
        int l = a.length;
        for(int i=from;i<l;++i){
            print(a[i]);
            if(i!=l-1){
                print(" ");
            }
        }
        println();
    }

    void printArray(long a[],int from){
        int l = a.length;
        for(int i=from;i<l;++i){
            print(a[i]);
            if(i!=l-1){
                print(" ");
            }
        }
        println();
    }
}


import java.util.*;
import java.io.*;
public class Main{
    static List<Integer> [] al;

    public static void main(String [] args) throws IOException{
        FastScanner sc=new FastScanner();
        int n=sc.nextInt();
        int m=sc.nextInt();
        al=new ArrayList[n];
        for(int i=0;i<n;i++)al[i]=new ArrayList<>();
        for(int i=0;i<m;i++){
            int u=sc.nextInt()-1;
            int v=sc.nextInt()-1;
            al[u].add(v);
            al[v].add(u);
        }

        Queue<Integer> q=new LinkedList<>();
        boolean [] vis=new boolean[n];
        int [] level=new int[n];
        q.add(0);
        vis[0]=true;
        while(!q.isEmpty()){
            int u=q.poll();
            for(int v : al[u]){
                if(!vis[v]){
                    vis[v]=true;
                    q.add(v);
                    level[v]=u;
                }
            }
        }

        for(int i=0;i<n;i++){
            if(!vis[i]){
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
        StringBuilder sb=new StringBuilder("");
        for(int i=1;i<n;i++)sb.append(level[i]+"\n");
        System.out.println(sb.toString().trim());

    }

}

class FastScanner{
    private int BUFFER_SIZE = 1 << 16;

   private  DataInputStream din;

   private  byte[] buffer;

   private int bufferPointer, bytesRead;

   public FastScanner() {
       din = new DataInputStream(System.in);
       buffer = new byte[BUFFER_SIZE];
       bufferPointer = bytesRead = 0;
   }

   public FastScanner( String file_name) throws IOException {
       din = new DataInputStream(new FileInputStream(file_name));
       buffer = new byte[BUFFER_SIZE];
       bufferPointer = bytesRead = 0;
   }

   public String readLine() throws IOException {
        byte[] buf = new byte[64];
       int cnt = 0, c;
       while ((c = read()) != -1) {
           if (c == '\n')
               break;
           buf[cnt++] = (byte) c;
       }
       return new String(buf, 0, cnt);
   }

   public String next() throws IOException{

       byte c = read();
       while(Character.isWhitespace(c)){
           c = read();
       }

        StringBuilder builder = new StringBuilder();
       builder.append((char)c);
       c = read();
       while(!Character.isWhitespace(c)){
           builder.append((char)c);
           c = read();
       }

       return builder.toString();
   }

   public int nextInt() throws IOException {
       int ret = 0;
       byte c = read();
       while (c <= ' ')
           c = read();
        boolean neg = (c == '-');
       if (neg)
           c = read();
       do {
           ret = ret * 10 + c - '0';
       } while ((c = read()) >= '0' && c <= '9');

       if (neg)
           return -ret;
       return ret;
   }

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

   public long nextLong() throws IOException {
       long ret = 0;
       byte c = read();
       while (c <= ' ')
           c = read();
        boolean neg = (c == '-');
       if (neg)
           c = read();
       do {
           ret = ret * 10 + c - '0';
       } while ((c = read()) >= '0' && c <= '9');
       if (neg)
           return -ret;
       return ret;
   }

   public long[] nextLongArray( int n) throws IOException {
        long arr[] = new long[n];
       for(int i = 0; i < n; i++){
           arr[i] = nextLong();
       }
       return arr;
   }

   public char nextChar() throws IOException{
       byte c = read();
       while(Character.isWhitespace(c)){
           c = read();
       }
       return (char) c;
   }

   public double nextDouble() throws IOException {
       double ret = 0, div = 1;
       byte c = read();
       while (c <= ' ')
           c = read();
        boolean neg = (c == '-');
       if (neg)
           c = read();

       do {
           ret = ret * 10 + c - '0';
       } while ((c = read()) >= '0' && c <= '9');

       if (c == '.') {
           while ((c = read()) >= '0' && c <= '9') {
               ret += (c - '0') / (div *= 10);
           }
       }

       if (neg)
           return -ret;
       return ret;
   }

   public double[] nextDoubleArray( int n) throws IOException {
        double arr[] = new double[n];
       for(int i = 0; i < n; i++){
           arr[i] = nextDouble();
       }
       return arr;
   }

   private void fillBuffer() throws IOException {
       bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
       if (bytesRead == -1)
           buffer[0] = -1;
   }

   private byte read() throws IOException {
       if (bufferPointer == bytesRead)
           fillBuffer();
       return buffer[bufferPointer++];
   }

   public void close() throws IOException {
       if (din == null)
           return;
       din.close();
   }

}