jiahuimbzuai/CoQuIR huggingface dataset:
//  [c]
#include<stdio.h>
#include<string.h>
int main()
{
  int n, l, h, h1, h2, x, y, z;
  char a[100];
  gets(a);
  n = strlen(a);
  l = 0;
  h = n - 1;
  h1 = ((n-1)/2) - 1;
  h2 = ((n+3)/2) - 1;
  
  while(h>l)
  {
      if(a[l++]!=a[h--])
      {
          x = 0;
          break;
      }
      if(l>=h)
      x = 1;
  }
  
  l = 0;
  while(h1>l)
  {
      if(a[l++]!=a[h1--])
      {
          y = 0;
          break;
      }
      if(l>=h1)
      y = 1;
  }
  
  h = n - 1;
  while(h>h2)
  {
      if(a[h2++]!=a[h--])
      {
          z = 0;
          break;
      }
      if(h2>=h)
      z = 1;
  }
  
  if(x==1 && y==1 && z==1)
  printf("Yes\n");
  else
  printf("No\n");
  
  return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>

int main(void){
 char s[100],t[100];
  scanf("%s",s);
  int l=strlen(s);
  for(int i=0;i<l;i++){
    t[l-1-i]=s[i];
  }
  for(int i=0;i<l;i++){
    if(s[i]!=t[i] || s[0]!=s[(l-1)/2]){
      printf("No");
      return 0;
  }
  }
  printf("Yes");
    return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>

int main(void){
 char s[100],t[100];
  scanf("%s",s);
  int l=strlen(s);
  for(int i=0;i<l;i++){
    t[l-1-i]=s[i];
  }
  for(int i=0;i<l;i++){
    if(s[i]!=t[i]){
      printf("No");
      return 0;
  }
  }
  printf("Yes");
    return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>

int main(void){
 char s[100],t[100];
  scanf("%s",s);
  int l=strlen(s);
  for(int i=0;i<l;i++){
    s[i]=t[l-1-i];
  }
  for(int i=0;i<l;i++){
    if(s[i]!=t[i]){
      printf("No");
      return 0;
  }
  }
  printf("Yes");
    return 0;
}
//  [javascript]
"use strict";

const isCycle = function(s){
    let l = 0
    let r = s.length-1
    while(l<=r){
        if(s[l] !== s[r]) return false
        l++
        r--
    }
    return true
}

const main = arg => {
    const input = arg.trim().split("\n");

    const S = input[0];
    const N = S.length
    let first = isCycle(S)
    let sec = isCycle(S.slice(0, (N-1)/2))
    let third = isCycle(S.slice((N+3)/2-1))
    if(first && sec && third) console.log("Yes")
    else console.log("No")
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
"use strict";function Main(t){const e=t=>{const e=t.length;for(let n=0;n<(e-1)/2;n++){if(t[n]!=t[e-1-n])return!1}return!0},n=(t=t.split("")).length;console.log(e(t)&&e(t.slice(0,(n-1)/2))&&e(t.slice((n+3)/2-1))?"Yes":"No")} Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
function main(input) {
  var S = input[0];
  var N = S.length;

  var resCount = 0;
  if(palindrome(N, S)){
  	resCount +=1;
  };
  
  var headS = S.slice(0, (N-1)/2);
  if(palindrome(headS.length, headS)){
    resCount +=1;
  }
  
  var TailS = S.slice((N +3)/2 -1, N);
  if(palindrome(TailS.length, TailS)){
    resCount +=1;
  }
  
  if(resCount === 3){
  	console.log('Yes');
  }else{
  	console.log('No');
  }  
}

function palindrome(N, S){
  
    var mid = Math.floor(N/2);
	for ( var i = 0; i < mid; i++ ) {
    if (S[i] !== S[N - 1 - i]) {
      return false;
    }
  }

  return true;
}

main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));
//  [javascript]
'use strict';
function Main(input) {
	input = input.trim().split("");  

  	let n = input.length;
  	let l = (n - 1) / 2;
  	let r = (n + 3) / 2;
  	let left = [];
  	let right = [];
  	for(let i = 0; i < l; i++){
      left.push(input[i])
    }
  	for(let i = r-1; i < n; i++){
      right.push(input[i])
    }
  
	for(let i = 0 ; i < Math.floor(left.length/2); i++){
      let e = left.length-1-i;
      if(left[i] !== left[e]){
        console.log('No');
        return;
      }
    }
  	for(let i = 0 ; i < Math.floor(right.length/2); i++){
      let e = right.length-1-i;
	  if(right[i] !== right[e]){
        console.log('No');
        return;
      }
    }
  	console.log('Yes');
}


//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict';
function main(input) {
  const arr = input.trim().split('\n')[0];
  const howLong = arr.length;
  let isStrong = false;
  let isKaibun = false;

  if (kaibun(howLong)) {
    if (kaibun((howLong - 1) / 2)) {
      if (kaibun(howLong + 3) / 2) {
        isStrong = true;
      }
    }
  }
  
  function kaibun (howLong) {
    for (let i = 0; i < (howLong / 2); i ++) {
      if (arr[i] !== arr[howLong - i]) {
        return;
      }
      return isKaibun = true;
    }
  }

  console.log(isStrong ? 'Yes' : 'No');
}


main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict';
function main(input) {
  const arr = input.trim().split('\n')[0];
  const howLong = arr.length;
  let isStrong = false;
  let isKaibun = false;

  if (kaibun(howLong)) {
    if (kaibun((howLong - 1) / 2)) {
      if (kaibun(howLong+ 3) / 2) {
        isStrong = true;
      }
    }
  }
  
  function kaibun (howLong) {
    for (let i = 0; i < (howLong / 2); i ++) {
      if (arr[i] !== arr[howLong - 1]) {
        return;
      }
      return isKaibun = true;
    }
  }

  console.log(isStrong ? 'Yes' : 'No');
}


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

import "fmt"

func main() {
	var S string
	fmt.Scanf("%s", &S)

	if isKaibun(S) && isKaibun(S[0:(len(S)-1)/2]) && isKaibun(S[(len(S)+3)/2-1:]) {
		fmt.Println("Yes")
		return
	}

	fmt.Println("No")
}

func isKaibun(s string) bool {
	for i := 0; i < len(s)/2; i++ {
		if s[i] != s[len(s)-1-i] {
			return false
		}
	}
	return true
}
//  [go]
package main

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

func main() {
	nextReader = newScanner()
	s := nextString()

	n := len(s)
	if !palindrome(s) {
		fmt.Println("No")
		return
	}
	if !palindrome(s[:(n-1)/2]) {
		fmt.Println("No")
		return
	}
	if !palindrome(s[(n+3)/2-1 : n]) {
		fmt.Println("No")
		return
	}
	fmt.Println("Yes")
}

func palindrome(s string) bool {
	i, j := 0, len(s)-1
	for i < j {
		if s[i] != s[j] {
			return false
		}
		i++
		j--
	}
	return true
}

// ---------------------------------------------------------------
// I/O
// ---------------------------------------------------------------
var nextReader func() string

func newScanner() func() string {
	sc := bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, 1024), int(1e11))
	sc.Split(bufio.ScanWords)
	return func() string {
		sc.Scan()
		return sc.Text()
	}
}

func nextString() string { return nextReader() }

func nextInt() int { n, _ := strconv.Atoi(nextReader()); return n }

func nextInts(size int) []int {
	ns := make([]int, size)
	for i := 0; i < size; i++ {
		ns[i] = nextInt()
	}
	return ns
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	sc.Split(bufio.ScanWords)
	defer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()
	/* --- code --- */
	S := next()
	N := len(S)
	if S == reverse(S) {
		if S[:(N-1)/2] == reverse(S[:(N-1)/2]) {
			fmt.Println("Yes")
			return
		}
	}
	fmt.Println("No")
}

func reverse(s string) string {
	rs := []rune(s)
	for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
		rs[i], rs[j] = rs[j], rs[i]
	}
	return string(rs)
}

// -*-*-*-*-*-*-*-*-
// * I/O utilities *
// -*-*-*-*-*-*-*-*-

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

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextInt64() int64 {
	a, _ := strconv.ParseInt(next(), 10, 64)
	return a
}

func nextFloat64() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextFloat64()
	}
	return ret
}
func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func split(s string) []string {
	ret := make([]string, len([]rune(s)))
	for i, v := range []rune(s) {
		ret[i] = string(v)
	}
	return ret
}

func PrintOut(src interface{}, joinner string) {
	switch reflect.TypeOf(src).Kind() {
	case reflect.Slice:
		s := reflect.ValueOf(src)
		for idx := 0; idx < s.Len(); idx++ {
			fmt.Fprintf(out, "%v", s.Index(idx))
			if idx < s.Len()-1 {
				fmt.Fprintf(out, "%s", joinner)
			} else {
				fmt.Fprintln(out)
			}
		}
	default:
		fmt.Fprintln(out, "fuck")
	}
}

// -*-*-*-*-*-*-*-*-
// * tool snippets *
// -*-*-*-*-*-*-*-*-
func duplicate2Int(base [][]int) (ret [][]int) {
	ret = make([][]int, len(base))
	for i, v := range base {
		ret[i] = append([]int{}, v...)
	}
	return
}

// -*-*-*-*-*-*-*-*-*-*-*-*-*-
// * Algorithms Utility Zone *
// -*-*-*-*-*-*-*-*-*-*-*-*-*-

// -*-*-*-*-*-*-*-
// * 1. nibutan  *
// -*-*-*-*-*-*-*-
func lower_bound(arr []int, target int) int {
	l, r := 0, len(arr)
	for l < r {
		mid := (l + r) / 2
		if arr[mid] < target {
			l = mid + 1
		} else {
			r = mid
		}
	}
	return l
}

func upper_bound(arr []int, target int) int {
	l, r := 0, len(arr)
	for l < r {
		mid := (l + r) / 2
		if target < arr[mid] {
			r = mid
		} else {
			l = mid + 1
		}
	}
	return l
}

// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
// * math flavor typical theories *
// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
func gcd(a, b int) int {
	if a > b {
		return gcd(b, a)
	}
	for a != 0 {
		a, b = b%a, a
	}
	return b
}

func pow(a, b int) (ret int) {
	ret = a
	// 10^2 = 100ってことは10に10を1回掛けることだね
	// なので初期値を含めると上限b-1未満
	for i := 0; i < b-1; i++ {
		ret *= a
	}
	return
}

func powMod(n, m, mod int) (ret int) {
	ret = 1
	for m > 0 {
		if m&1 == 1 {
			ret *= n
			ret %= mod
		}
		n *= n
		n %= mod
		m >>= 1
	}
	return ret
}
//  [ruby]
s = gets.chomp
n = s.size

s1 = s[0,(n-1)/2]
s2 = s[(n+1)/2..-1]

if s === s.reverse && s1 === s1.reverse && s2 === s2.reverse
  puts "Yes"
else
  puts "No"
end
//  [ruby]
s = gets.chomp
n = s.size
ss = s[0...n/2]
sss = s[(n/2+1)...n]

if s == s.reverse && ss == ss.reverse && sss == sss.reverse
  puts "Yes"
else
  puts "No"
end
//  [ruby]
s = gets.chomp
n = s.length
v = s[0..((n - 1) / 2) - 1]
w = s[(((n + 3) / 2) - 1)..n]

if (s == s.reverse) && (v == v.reverse) && (w == w.reverse)
  puts "Yes"
else
  puts "No"
end
//  [ruby]
s = gets.chomp.chars
i = 0
while i < s.size/2
  puts s[i]
  puts s[((s.size - 1)/2)-i-1]
  puts s[s.size - i - 1]
  puts s[(s.size + 3)/2+i-1]
  unless (s[i] == s[((s.size - 1)/2)-i-1]) && (s[i] == s[s.size - i - 1]) && (s[i] == s[(s.size + 3)/2+i-1])
    break
  end
  i += 1
end
if i == s.size/2
  puts "Yes"
else
  puts "No"
end
//  [ruby]
s = gets.chomp.split("").map(&:to_s);
sl=s.length

ans = "Yes"


ck1 = s.slice(0..(sl/2)-1)
ck2 = s.slice(((sl/2)+1)..sl-1).reverse

if (ck1!=ck2) then
	ans = "No"
end

#check2
s2 = s.slice(0..(sl/2)-1)
s2l=s2.length

if s2l%2==0 then
	ck3 = s2.slice(0..(s2l/2))
	ck4 = s2.reverse.slice(0..(s2l/2))
	if ck3 != ck4 then
		ans ="No"
	end

else
	ck3 = s2.slice(0..(s2l/2)-1)
	ck4 = s2.revers.slice(0..(s2l/2)-1)
	if ck3 != ck4 then
		ans ="No"
	end
end

puts ans
//  [ruby]
s = gets.chomp.split("").map(&:to_s);
sl=s.length

ans = "Yes"


ck1 = s.slice(0..(sl/2)-1)
ck2 = s.slice(((sl/2)+1)..sl-1).reverse

if (ck1!=ck2) then
	ans = "No"
end

#check2
s2 = s.slice(0..(sl/2)-1)
s2l=s2.length

if s2l%2==0 then
	ck3 = s2.slice(0..(s2l/2))
	ck4 = s2.slice(((s2l/2)+1)..s2l-1).reverse
	if ck3 != ck4 then
		ans ="No"
	end
else
	ck3 = s2.slice(0..(s2l/2)-1)
	ck4 = s2.slice(((s2l/2)+1)..s2l-1).reverse
	if ck3 != ck4 then
		ans ="No"
	end
end
puts ans
//  [rust]
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

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

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let s: Vec<char> = iterator.next().unwrap().chars().collect();
    let n = s.len();
    for i in 0..(n / 2) {
        if s[i] != s[n - 1 - i] {
            return "No".to_string();
        }
    }
    for i in 0..(n / 4) {
        if s[i] != s[n / 2 - 1 - i] {
            return "No".to_string();
        }
        if s[n / 2 + 1 + i] != s[n - 1 - i] {
            return "No".to_string();
        }
    }

    return "Yes".to_string();
}
//  [rust]
/* {{{ */
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let 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)*}
    };
}

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

fn main() {
    input! {
        s: chars
    }
    let n = s.len();
    let f = |a: &[char]| -> bool {
        let mut b = Vec::from(a);
        b.reverse();
        a.iter().zip(b.iter()).all(|(a,b)| a == b)
    };
    if f(&s) && f(&s[0..(n/2)]) && f(&s[(n/2+1)..n]) {
        println!("Yes");
    } else {
        println!("No");
    }
}
/* vim:set foldmethod=marker: */
//  [rust]
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 main() {
    let s:String = read();
    let s:Vec<_> = s.chars().collect();
    let n = s.len();

    let parin = |xs:&[_]| {
        let n = xs.len();
        for i in 0..(n/2) {
            if xs[i] != xs[n-i-1] {
                return false
            }
        }
        true
    };

    let flg = parin(&s[..]);
    let flg = flg && parin(&s[..(n-1)/2]);
    let flg = flg && parin(&s[(n+1)/2..]);

    println!("{}", if flg { "Yes" } else { "No" });
}
//  [rust]
use proconio::input;

fn is_palindrome(s: String) -> bool {
  let r: String = s.chars().rev().collect();
  return s == r;
}
fn is_string_palindrome(s: String) -> bool {
  let n = s.len();
  is_palindrome((&s[0..n]).to_string()) && 
  is_palindrome((&s[..(n-1)/2]).to_string()) &&
  is_palindrome((&s[(n+3)/2+1..n]).to_string())
}

fn main() {
  input! {
    s: String,
  }
  if is_string_palindrome(s) {
    println!("Yes");
  } else {
    println!("No");
  }
}
//  [swift]
import Foundation

func terms1(s:String) -> Bool {
    return s == String(s.reversed())
}

func terms2(s:String) -> Bool {
    return s.prefix((s.count - 1) / 2) == String(s.prefix((s.count - 1) / 2).reversed())
}

func terms3(s:String) -> Bool {
    return s.suffix(s.count - (s.count + 3) / 2 + 1) == s.suffix(s.count - (s.count + 3) / 2 + 1).reversed()
}



func main() {
    let s = readLine()!
    
    print(terms1(s: s) && terms2(s: s) && terms3(s: s) ? "Yes": "No")
}
main()
//  [swift]
import Foundation

let input = readLine()!
let N = input.count

let firstString  = input
let endString = input

let firstPalindrome = input.dropLast((N - 1) / 2 + 1).map{ String($0)}
let endPalindrome = input.dropFirst((N + 3) / 2 - 1).map{ String($0)}

let StringNums = firstString.count
let halfNums = StringNums / 2

var firstReversed: [String] = []
var endReversed: [String] = []



for i in (0...halfNums - 1).reversed() {
    firstReversed.append(firstPalindrome[i])
    endReversed.append(endPalindrome[i])
}

if firstPalindrome == firstReversed && endPalindrome == endReversed && firstReversed == endPalindrome {
    print("Yes")
} else {
    print("No")
}
//  [swift]
import Foundation
func isValid(s: String, start: Int, end: Int) -> Bool {
  if start > end {
    return false
  }
  var left = start
  var right = end
  let S = s.characters.map { String($0) }
  while left < right {
    if S[left] != S[right] {
    	return false
    }
    left += 1
    right -= 1
  }
  return true
}
let str = String(readLine()!)
let count = str.characters.count
let isStrong = isValid(str, start: 0, end: (count - 1) / 2 - 1) && 
			   isValid(str, start: 0, end: count - 1) &&
               isValid(str, start: (count + 3) / 2 - 1, end: str.characters.count - 1)

print(isStrong ? "Yes" : "No")
//  [swift]
import Foundation

let input = readLine()!
let N = input.count

let firstString  = input
let endString = input

let firstPalindrome = input.dropLast((N - 1) / 2 + 1).map{ String($0)}
let endPalindrome = input.dropFirst((N + 3) / 2 - 1).map{ String($0)}

let StringNums = firstString.count
let halfNums = StringNums / 2

var firstReversed: [String] = []
var endReversed: [String] = []


for i in (0...halfNums - 1).reversed() {
    firstReversed.append(firstPalindrome[i])
    endReversed.append(endPalindrome[i])
}

if firstPalindrome == firstReversed && endPalindrome == endReversed {
    print("Yes")
} else {
    print("No")
}
//  [swift]
import Foundation

let input = readLine()!
let N = input.count

let firstString  = input
let endString = input


let firstPalindrome = input.dropLast((N - 1) / 2 + 1).map{ String($0)}
let endPalindrome = input.dropFirst((N + 3) / 2 - 1).map{ String($0)}




let StringNums = firstString.count
let halfNums = StringNums / 2



for i in 0...halfNums - 1 {
    if firstPalindrome[i] != firstPalindrome[halfNums - i - 1] || endPalindrome[i] != endPalindrome[halfNums - i - 1] {
        print("No")
        break
    } else if i == halfNums - 1 {
        print("Yes")
    }
}
//  [swift]
import Foundation
func isValid(s: String, start: Int, end: Int) -> Bool {
  if start > end {
    return false
  }
  var left = start
  var right = end
  let S = s.characters.map { String($0) }
  while left < right {
    if S[left] != S[right] {
    	return false
    }
    left += 1
    right -= 1
  }
  return true
}
let str = String(readLine()!)
let count = str.characters.count
let isStrong = isValid(str, start: 0, end: (count - 1) / 2 - 1) && 
               isValid(str, start: (count + 3) / 2 - 1, end: str.characters.count - 1)

print(isStrong ? "Yes" : "No")
//  [typescript]
function Main(arg: string) {
  const input = arg.split('\n')[0];
  const length = input.length;
  const a = check(input);
  const b = check(input.substr(0, (length  -1)/2 ));
  const c = check(input.substr((length +3)/2 - 1));
  console.log(a && b && c ? 'Yes': 'No');
}


function check(str: string) {
  const length = str.length;
  for (let i = 0; i < Math.floor(length / 2); i++) {
    if (str.charAt(i) !== str.charAt(length - i - 1))return false;
  }
  return true;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
function main(input) {
  const inputs =input.split('\n')
  const [S] = inputs[0].split(' ')
  const N = S.length
  const h = S.slice(0, (N-1)/2)
  const t = S.slice((N+2)/2, N)

  if (h !== t) {
    console.log('No')
    return
  }
  for (let i = 0; i < (h.length-1)/2; i++) {
    if (h[i] !== h[h.length-1-i]) {
      console.log('No')
      return
    }
  }
  console.log('Yes')
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [typescript]
export class Main {
  static main(input: string): string {
    const tmp: string[] = input.split("\n");
    const s: string = tmp.shift().split(" ")[0];
    for (let i = 0, len = (s.length - 1) / 2; i < len; i++) {
      if (s.charAt(i) != s.charAt(s.length - 1 - i)) {
        return "No";
      }
    }
    const sh: string = s.substr(0, (s.length - 1) / 2);
    for (let i = 0, len = (sh.length - 1) / 2; i < len; i++) {
      if (sh.charAt(i) != sh.charAt(sh.length - 1 - i)) {
        return "No";
      }
    }
    return `Yes`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [typescript]
function main(input) {
  const inputs =input.split('\n')
  const [S] = inputs[0].split(' ')
  const N = S.length
  const h = S.slice(0, (N-1)/2)
  const t = S.slice((N+2)/2, N)

  if (h.length % 2 === 0) {
    console.log('No')
    return
  } else if (h !== t) {
    console.log('No')
    return
  }
  for (let i = 0; i < (h.length-1)/2; i++) {
    if (h[i] !== h[h.length-1-i]) {
      console.log('No')
      return
    }
  }
  console.log('Yes')
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [typescript]
function Main(arg: string) {
  const input = arg.split('\n')[0];
  const length = input.length;
  const a = check(input);
  const b = check(input.substr(0, (length  -1)/2 ));
  const c = check(input.substr((length +3)/2 - 1));
  console.log(input.substr(0, (length  -1)/2), input.substr((length +3)/2 - 1) ), 
  console.log(a && b && c ? 'Yes': 'No');
}


function check(str: string) {
  const length = str.length;
  for (let i = 0; i < Math.floor(length / 2); i++) {
    if (str.charAt(i) !== str.charAt(length - i - 1))return false;
  }
  return true;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e-a > k :
  print(":(")
else :
  print("Yay!")
//  [python]
lis = []

for i in range(5):
    lis.append(int(input()))

NUM = int(input())

count = 0
correct = 0
for i in range(5):
    for k in range(i + 1, 5):
        if lis[k] - lis[i] <= NUM and lis[i] - lis[k] <= NUM:
            correct += 1
        count += 1

if count == correct:
    print('Yay!')
else:
    print(':(')
//  [python]
crd = []
a = int(input())
crd.append(a)
b = int(input())
crd.append(b)
c = int(input())
crd.append(c)
d = int(input())
crd.append(d)
e = int(input())
crd.append(e)
k = int(input())

#print(len(crd))
for x in range(len(crd)):
    for y in range(x+1, len(crd)-x):
        #print(x, y)
        #print(crd[int(x)], crd[int(y)])
        z = k - (crd[y] - crd[x])
        #print("z= ", z)
        if z < 0:
            print(":(")
            break
    else:
        continue
    break
else:
    print("Yay!")
//  [python]
a = [int(input()) for x in range(5)]
k = int(input())

flg = True

for i, x in enumerate(a):
  for j, y in enumerate(a):
    if i == j:
      continue
      
    flg = flg and abs(y-x) > k
    
print('Yay!' if flg else ":(")
//  [python]
k=0
l=[]
for i in range(6):
    l.append(int(input()))
for i in range(1,5):
    if l[i]-l[i-1]>l[5]:
        k+=1
        break
if k==0:
    print("Yay!")
else:
    print(":(")
//  [python]
#include <bits/stdc++.h>
using namespace std;

int main(){
  int a,b,c,d,e,k;
  cin >> a >> b >> c >> d >> e >> k;
  
  if( e - a > k){
    cout << ":(";
  }else{
    cout << "Yay!";
  }
}
//  [java]

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	static int[][] memo;

	public static int hoge(int current, int n, String last) {
		return 0;
	}

	public static void main(String[] args) throws IOException {
		BufferedReader bf = null;
		bf = new BufferedReader(new InputStreamReader(System.in));
		int a,e,k;
		String str;
		str = bf.readLine();
		a = Integer.parseInt(str);
		str = bf.readLine();
		str = bf.readLine();
		str = bf.readLine();
		str = bf.readLine();
		e = Integer.parseInt(str);
		str = bf.readLine();
		k = Integer.parseInt(str);
		if(e-a <= k) {
			System.out.println("Yay!");
		} else {
			System.out.println(":(");
		}
	}
}
//  [java]
import java.util.*;
public class Main{
  public static void main(String[] args){
  	Scanner sc = new Scanner(System.in);
    int[] nums = new int[5];
    for(int i = 0;i < 5;i++){
      nums[i] = sc.nextInt();
    }
    int tail = Integer.MAX_VALUE;
    int min = 0;
    for(int j : nums){
      	int temp = j % 10;
    	if(temp != 0 && tail > temp){
        	tail = temp;
          	min = j;
        }
    }
    int sum = 0;
    for(int j : nums){
    	if(j != min){
          if(j % 10 == 0){
             sum += j;
          }else{
            sum += (j / 10) *10 + 10;
          }
        }
    }
    System.out.println(sum + min);
  }
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int a[] = new int[5];

		for (int i = 0; i < 5; i++) {
			a[i] = Integer.parseInt(br.readLine());
		}
		int k = Integer.parseInt(br.readLine());

		for (int i = 0; i < 4; i++) {
			if (a[i + 1] - a[i] > k) {
				System.out.println(":(");
				return;
			}
		}

		System.out.println("Yay!");
	}
}
//  [cpp]
#include <cstdio>

int main() {
  int a[5];
  for (int i = 0; i < 5; ++i) scanf("%d", &a[i]);
  int k;
  scanf("%d", &k);
  for (int i = 0; i < 5; ++i)
    for (int j = 0; j < i; ++j)
      if (a[i] - a[j] > k)
        return puts(":("), 0;
  
  puts("Yay!");
}
//  [cpp]
#include<stdio.h>
#include<stdlib.h>
int main(){
    int a ,b ,c ,d ,e , f;
    scanf("%d%d%d%d%d%d", &a,&b,&c,&d,&e,&f);
    int arr[] = {a,b,c,d,e} ;
    int i , j  , count = 0 ;
    for(i = 0 ; i < 4 ; i++){
        for(j=i+1 ; j<5 ; j++){
            if((arr[j]-arr[i]) > f){
                count++;
                //printf("%d - %d = %d \n" , arr[j], arr[i] ,arr[j] - arr[i]);

            }

        }
    }
    if(count >0){
        printf(":(");
    }else{
        printf("Yay!");
    }

}
//  [cpp]
#include <stdio.h>
int main(){
  int a, b, c, d, e, k;
  scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &k);

  if( ((a-b)<=k) && ((a-c)<=k) && ((a-d)<=k) && ((a-e)<=k) && ((b-a)<=k) && ((b-c)<=k) && ((b-d)<=k) && ((b-e)<=k) && ((c-a)<=k) && ((c-b<=k)) && ((c-d)<=k) && ((c-e)<=k) && ((d-a)<=k) && ((d-b)<=k) && ((d-c)<=k) && ((d-e)<=k) && ((e-a)<=k) && ((e-b)<=k) && (e-c)<=k && (e-d)<=k)
    printf("Yay!\n");
  else printf(":(\n");

  return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//cout << fixed << setprecision(15);
vector<int> forintinput(int n) {
	vector<int> x;
	for(int i = 0;i < n;i++){
		int ia;
		cin >> ia;
		x.push_back(ia);
	}
	return x;
}
int main(){
	int a,b,c,d,e,k;
	cin >> a >> b >> c >> d >> e >> k;
	if(e-a >= k){
		cout << ":(" << endl;
	}else{
		cout << "Yay!" << endl;
	}
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=0;(i)<(n);i++)
#define INF 1001001001
#define LLINF 1001001001001001001
#define MOD 1000000007
#define FOUT(n, dist) cout<<fixed<<setprecision(n)<<(dist);
#define BR cout<<endl;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define ALL(v) v.begin(), v.end()
typedef long long ll;
const ll mod=1000000007;

ll powmod(ll x,ll y){
    ll res=1;
    for(ll i=0;i<y;i++){
        res=res*x%mod;
    }
    return res;
}

double expect(int x){
    double kitai,tem=0;
    for(int i=1;i<=x;i++){
        tem += i;
    }
    kitai = tem/x;
    cout << kitai << endl;
    return kitai;
    
}

int main(){
    int dist[5];
    rep(i,5)cin >> dist[i];

    int k;
    cin >> k;

    for(int j = 0;j < 4 ;j++){
    for(int i = 0;i < 4;i++){
        if(dist[i] - dist[j] > k){
            cout << ":(" << endl;
            return 0;
        }
    }
    }
     
    cout << "Yay!" << endl;

    


    return 0;
}
//  [cpp]
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, c, d, e, k;
    cin >> a >> b >> c >> d >> e >> k;
    if(e - a < k) {
        cout << "Yay!" << endl;
    } else {
        cout << ":(" << endl;
    }

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

void print(void)
{
        printf(":(\n");
        return ;
}
int main(void)
{
        int a,b,c,d,e,k;
        scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&k);

        if(b-a>k)print();
        else if(c-a>k)print();
        else if(d-a>k)print();
        else if(e-a>k)print();
        else if(c-b>k)print();
        else if(d-b>k)print();
        else if(e-b>k)print();
        else if(d-c>k)print();
        else if(e-c>k)print();
        else if(e-d>k)print();
        else printf("Yay!\n");
        return 0;
}
//  [c]
#include <stdio.h>

int main(){
  int densen[5];
  for(int i=0; i<5; i++){
    scanf("%d", &densen[i]);
  }
  int k;
  scanf("%d", &k);
  
  //全探索
  int hasConnection = 0; //0でAllOK、1で通信できない
  for(int i=0; i<5; i++){
    for(int j=0; j<5; j++){
      if((densen[i] - densen[j]) > k) hasConnection = 1;
    }
  }

  if(hasConnection == 1){
    printf(":(");
  }else{
    printf("Yay!");
  }
  
}
//  [c]
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define MAX 1000                                      
typedef long long ll;
typedef unsigned long long ull;
extern inline int max( int a, int b ) { return a > b ? a : b ; }
extern inline int min( int a, int b ) { return a > b ? b : a ; }
extern inline ll lmax( ll a, ll b ) { return a > b ? a : b ; }
extern inline ll lmin( ll a, ll b ) { return a > b ? b : a ; }
extern inline ull ulmax( ull a, ull b ) { return a > b ? a : b ; }
extern inline ull ulmin( ull a, ull b ) { return a > b ? b : a ; }

int main()
{
	int arr[5];
	int K;
	
	for( int i=0; i<5; ++i ){
		scanf("%d", arr+i);
	}
	scanf("%d", &K);
	
	for( int i=0; i<4; ++i ){
		for( int j=i+1; j<5; ++j ){
			if( arr[j] - arr[i] > K ){
				printf(":(\n");
				return 0;
			}
		}
	}
	printf("Yay!\n");	
	return 0;
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
int main(void)
{	
	int s[5];
	int k;
	int p=0;
	
	for(int i=0;i<5;i++)
		scanf("%d",&s[i]);
	scanf("%d",&k);
	
	for(int i=0;i<4;i++)
	{
		for(int n=1;n+i<5;n++)
		{	
			if(abs(s[i]-s[n+i])<=k){
				
				p++;
		}
		
	}
	
	}
	
	if(p==20)
	printf("Yay!");
	
	else
	printf(":(");
	

	return 0;
}
//  [c]
#include<stdio.h>
int main(void)
{	
	int s[5];
	int k;
	int p=0;
	
	for(int i=0;i<5;i++)
		scanf("%d",&s[i]);
	scanf("%d",&k);
	
	for(int i=0;i<4;i++)
	{
		for(int n=1;n+i<5;n++)
		{	
			if(s[i]-s[n+i]<=k){
				p++;
		}
		
	}
	
	}
	
	if(p==10)
	printf("Yay!");
	
	else
	printf(":(");
	
	return 0;
}
//  [c]
#include<stdio.h>
int main(void)
{	
	int s[5];
	int k;
	int p=0;
	
	for(int i=0;i<5;i++)
		scanf("%d",&s[i]);
	scanf("%d",&k);
	
	for(int i=0;i<4;i++)
	{
		for(int n=1;n+i<5;n++)
		{	
			if(s[i]-s[n+i]<=k){
				p++;
		}
		
	}
	
	}
	
	if(p==20)
	printf("Yay!");
	
	else
	printf(":(");
	

	return 0;
}
//  [javascript]
'use strict';

function Main(input) {
  const a = Number(input.split("\n")[0])
  const e = Number(input.split("\n")[4])
  const k = Number(input.split("\n")[5])
  
  if (e - a <= k) {
    console.log("Yay!")
  } else {
    console.log(":(")
  }
};

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
// inputに入力データ全体が入る
function Main(input) {
  var a,b,c,d,e,k;
  a = Number(input.split('\n')[0]);
  b = Number(input.split('\n')[1]);
  c = Number(input.split('\n')[2]);
  d = Number(input.split('\n')[3]);
  e = Number(input.split('\n')[4]);
  k = Number(input.split('\n')[5]);

  if(Math.max(e-a,e-b,d-a,e-c,d-b,c-a,e-d,d-c,c-b,b-a) > k){
    console.log(':(');
  }else{
    console.log('Yay!');
  }
  
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const a = parseInt(args[0][0], 10)
	const e = parseInt(args[4][0], 10)
	const k = parseInt(args[5][0], 10)
	if (e - a <= k) console.log('Yay!')
	else console.log(':(')
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [javascript]


'use strict';
// inputに入力データ全体が入る
function Main(input) {
  input = input.trim().split("\n");
  let modArr = input.map(function(val){
    val = parseInt(val);
    if(val%10===0){
      return 10;
    }else{
      return val%10;
    }
  });
  let min = modArr.indexOf(Math.min.apply(null, modArr));
  let last = parseInt(input[min]);

  input.splice(min, 1);
  let result =0;
  for(let i = 0 ; i< input.length; i++){
  	let x = Math.ceil(input[i] /10)*10;
    result += x;
  };
  result += last; 
  console.log('%d',result);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict';
// inputに入力データ全体が入る
function Main(input) {
  input = input.split("\n");
  let modArr = input.map(function(val){
    val = parseInt(val);
    if(val%10===0){
      return 10;
    }else{
      return val%10;
    }
  });
  let min = modArr.indexOf(Math.min.apply(null, modArr));
  let last = parseInt(input[min]);

  input.splice(min, 1);
  let result =0;
  for(let i = 0 ; i< input.length; i++){
  	let x = Math.ceil(input[i] /10)*10;
    result += x;
  };
  result += last;
  console.log(parseInt(result));  	
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
import * as fs from 'fs';

const main = (input: string) => {
  const lines = input.split("\n").map(str => parseInt(str));
  let answer = 0;
  let maxTime;
  let w: number[] = [];


  lines.forEach((time) => {
    if (time % 10 !== 0) {
      w.push(time % 10)
    }

    answer += (Math.round(time / 10) * 10)
  });

  maxTime = w.reduce((a, b) => Math.min(a, b))

  console.log(answer - maxTime);
};

main(fs.readFileSync('/dev/stdin', 'utf8').trim());
//  [go]
package main

import "fmt"

var a, b, c, d, e, k int

func check() bool {
	if e-d <= k && e-c <= k && e-b <= k && e-a <= k {
		if d-c <= k && d-b <= k && d-a <= k {
			if c-a <= k && b-a <= k {
				return true
			}
		}
	}
	return false
}

func main() {
	fmt.Scan(&a, &b, &c, &d, &e, &k)
	if check() {
		fmt.Println("Yay!")
	} else {
		fmt.Println(":(")
	}
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	// var a, b, c, d, e int
	// fmt.Scan(&a, &b, &c, &d, &e)
	ts := make([]int, 6)
	for i := 0; i < 6; i++ {
		fmt.Scan(&ts[i])
	}

	if ts[4]-ts[0] >= ts[5] {
		fmt.Print("Yay!")
	} else {
		fmt.Print(":(")
	}
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var a,b,c,d,e,k int
	fmt.Scan(&a,&b,&c,&d,&e,&k)

	if b - a >= k {
		fmt.Println(":(")
	} else if c - a >= k {
		fmt.Println(":(")
	} else if d - a >= k {
		fmt.Println(":(")
	} else if e - a >= k {
		fmt.Println(":(")
	} else if c - b >= k {
		fmt.Println(":(")
	} else if d - b >= k {
		fmt.Println(":(")
	} else if e - b >= k {
		fmt.Println(":(")
	} else if d - c >= k {
		fmt.Println(":(")
	} else if e - c >= k {
		fmt.Println(":(")
	} else if e - d >= k {
		fmt.Println(":(")
	} else {
		fmt.Println("Yay!")
	}
}
//  [ruby]
*a,k=$<.map &:to_i;puts a[-1]-a[0]>k ? ':(' : 'Yay!'
//  [ruby]
a = gets.to_i
b = gets.to_i
c = gets.to_i
d = gets.to_i
e = gets.to_i
k = gets.to_i

if e-a<=k
  puts "Yay!"
else
  puts ":("
end
//  [ruby]
a = gets.chomp.to_i
b = gets.chomp.to_i
c = gets.chomp.to_i
d = gets.chomp.to_i
e = gets.chomp.to_i
k = gets.chomp.to_i

array = [a, b, c, d, e]
array.each_with_index do |v, x|
  x = x+1
  x.upto(4) do |i|
    if array[i] - v > k
      puts ":("
      exit
    end
  end
end
puts "Yay!"
//  [ruby]
a=gets.to_i
gets
gets
gets
e=gets.to_i
k=gets.to_i
puts e-a <=k ? :Yes: :No
//  [ruby]
a = gets.to_i
b = gets.to_i
c = gets.to_i
d = gets.to_i
e = gets.to_i
k = gets.to_i

if (b-a < k) && (c-a < k) && (d-a < k) && (e-a < k) && (c-b < k) && (d-b < k) && (e-b < k) && (d-c < k) && (e-c < k) && (e-d < k)
  puts "Yay!"
else
  puts ":("
end
//  [ruby]
a = gets.to_i
b = gets.to_i
c = gets.to_i
d = gets.to_i
e = gets.to_i
k = gets.to_i

if e-a < k
  puts ":("
else
  puts "Yay!"
end
//  [rust]
#![allow(dead_code, unused_variables, unused_macros, unused_imports)]

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

fn main() {
    input! {
        a: [i32; 5],
        k: i32,
    }

    if a[4] - a[0] > k {
        println!(":(");
    } else {
        println!("Yay!");
    }
}
//  [rust]
use std::io;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let mut ant:Vec<i32> = Vec::new();
	let v:Vec<i32> = procon_read();
	ant.push(v[0]);
	let v:Vec<i32> = procon_read();
	ant.push(v[0]);
	let v:Vec<i32> = procon_read();
	ant.push(v[0]);
	let v:Vec<i32> = procon_read();
	ant.push(v[0]);
	let v:Vec<i32> = procon_read();
	ant.push(v[0]);
	let v:Vec<i32> = procon_read();
	let k:i32 = v[0];
	let mut flag = false;
	for i in 0..5 {
		for j in (i+1)..5 {
			if ant[j] - ant[i] > k{
				flag = true;
				break;
			}
		}
		if flag {
			break;
		}
	}
	if flag {
		println!(":(");
	}else{
		println!("Yay!");
	}
}
//  [rust]
fn main() {
    let a = read::<usize>();
    let b = read::<usize>();
    let c = read::<usize>();
    let d = read::<usize>();
    let e = read::<usize>();
    let v = [a, b, c, d, e];
    let k = read::<usize>();
    for i in 0..4 {
        for j in (i+1)..5 {
            if v[j] - v[i] > k {
                println!(":(");
                return;
            }
        }
    }
    println!("Yay!");
}

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

use text_io::*;
use proconio::*;
use std::collections::*;
use std::process::exit;
use std::cmp::*;
use itertools::Itertools;

fn main() {
    input! {
    a:usize,
    b:usize,
    c:usize,
    d:usize,
    e:usize,
    k:usize,
    }
    if max(a,max(b,max(c,max(d,e))))>k {println!(":(")}
    else { println!("Yay!") }
}
//  [rust]
#[allow(unused_imports)]
use std::io::Write;

#[allow(unused_macros)]
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)]
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)*}
    };
}

#[allow(unused_macros)]
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")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

#[allow(non_snake_case)]
fn main() {
    input![A: [i32; 6]];

    let m = A.iter().min().unwrap();
    let M = A.iter().max().unwrap();
    println!("{}", if M - m <= 15 { "Yay!" } else { ":(" });
}
//  [rust]
#![allow(unused_imports)]
use proconio::{input, fastout};
use proconio::marker::*;

#[fastout]
fn main() {
    input! {
    n: usize,
    c: [usize; 5]
    }
    let m = c.iter().min().unwrap();
    let ans: usize = 5 + n / m - if n % m == 0 {1} else {0};
    println!("{}", ans);
}
//  [swift]
var input: [Int] = []
(0..<5).forEach{_ in input.append(Int(readLine()!)!)}
print(input[4]-input[0] > Int(readLine()!)! ? ":(" : "Yay!")
//  [swift]
var a:[Int]=[];(0..<6).forEach{_ in a.append(Int(readLine()!)!)};print(a[4]-a[0]>a[5] ?":(":"Yay!")
//  [swift]
var input: [Int] = []
for _ in 0..<6 {
  let line = readLine()!
  input.append(Int(line)!)
}

let a = input[0]
let e = input[4]
let k = input[5]

if e - a <= k {
  print("Yay!")
} else {
  print(":(")
}
//  [swift]
import Foundation

class City {
    
    private let delay: Int
    private let initial: Int
    private let output: Int
    private let prev: City?
    
    init(delay: Int, initial: Int, output: Int, prev: City?) {
        self.delay = delay
        self.initial = initial
        self.output = output
        self.prev = prev
    }
    
    func total() -> Int {
        return prev?.total() ?? initial
    }
    
    func outputPerMin() -> Int {
        if let prev = prev {
            return min(prev.outputPerMin(), output)
        } else {
            return output
        }
    }
    
    func outputTimes() -> Int {
        return Int(ceil(Double(total()) / Double(outputPerMin())))
    }
    
    func totalTime() -> Int {
        return delay + outputTimes()
    }
}

let N = Int(readLine()!)!

var cities: [City] = []
var prev: City?
for i in 0 ..< 5 {
    let output = Int(readLine()!)!
    let city = City(
        delay: i,
        initial: i == 0 ? N : 0,
        output: output,
        prev: prev)
    cities.append(city)
    prev = city
}

let answer = cities.last!.totalTime()

print(answer)
//  [swift]
var a:[Int]=[];(0..<6).forEach{_ in a+=Int(readLine()!)!};print(a[4]-a[0]>a[5] ?":(":"Yay!")
//  [swift]
var input: [Int] = []
(0..<5).forEach{input.append(Int(readLine()!)!)}
print(input[4]-input[0] > Int(readLine()!)! ? ":(" : "Yay!")
//  [typescript]
import { readFileSync } from 'fs'

function main(input: string) {
  const lines = input.split('\n').map(Number)
  const antennas = lines.slice(0, 5)
  const k = lines[5]

  const max = Math.max(...lines)
  const min = Math.min(...lines)

  console.log((max - min) <= k ? 'Yay!' : ':(')
}

main(readFileSync('/dev/stdin', 'utf8').trim())
//  [typescript]

const solve = (input) => {
  const is = input.split("\n").map(Number)
  const m = is[4] - is[0]
  return is[5] >= m ? "Yay!" : ":("
}

if (process.env.NODE_ENV === "test") {
  // module.exports = (input) => solve(input.trim())
} else {
  const input = require("fs").readFileSync("/dev/stdin", "utf8")
  console.log(solve(input.trim()))
}
//  [typescript]
export class Main {
  static main(input): string {
    const [a, b, c, d, e, k]: number[] = input.split("\n").map(s => Number(s.split(" ")[0]));
    const l: number[] = [a, b, c, d, e];
    for (let i = 0; i < 4; i++) {
      for (let j = i + 1; j < 5; j++) {
        if (l[j] - l[i] > k) {
          return ":(";
        }
      }
    }
    return "Yay!";
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [typescript]
((input: string): void => {
    const hoge: number[] = input.split(/\n/).map(Number)
    const fuga = Math.abs(hoge[0]-hoge.slice(-2)[0]);
    console.log(fuga > hoge.slice(-1)[0] ? ':(' : 'Yay!');
})(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [python]
a, b = map(int, input().split())

print(max(a + b, a - b, a * b))
//  [python]
a,b=map(int,input().split())
print(max(a+b,a*b,a-b))
//  [python]
a, b = map(int, input().split())
 
m = a+b
if m<a*b:
    m = a*b
if m<a-b:
    m=a-b
print(m)
//  [python]
A,B=map(int,input().split())
if (A+B)>(A-B) and (A+B)>(A*B):
  print(A+B)
elif (A-B)>(A+B) and (A-B)>(A*B):
  print(A-B)
elif (A*B)>(A+B) and (A*B)>(A-B):
  print(A*B)
//  [python]
map(int,input().split())
print(max(A+B,A-B,A*B))
//  [python]
A, B = map(int, input(), split())

x = A + B
y = A - B
z = A * B
print(max(x, y, z))
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] ab = br.readLine().split(" ");
        int a = Integer.parseInt(ab[0]);
        int b = Integer.parseInt(ab[1]);
        System.out.println(problem137a(a, b));
    }

    private static int problem137a(int a, int b) {
        return Math.max(Math.max((a + b), (a - b)), (a * b));
    }
}
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve(args);
    }

    public void solve(String[] args) {
        MyScanner scanner = new MyScanner();
        int a = scanner.nextInt();
        int b = scanner.nextInt();

        int sum = a + b;
        int minus = a - b;
        int kake = a * b;

        int ans = Math.max(kake, Math.max(sum, minus));

        System.out.println(ans);
    }

    private static long gcd(long m, long n) {
        if(m < n) return gcd(n, m);
        if(n == 0) return m;
        return gcd(n, m % n);
    }

    private static long lcm(long m, long n) {
        return m * n / gcd(m, n);
    }

    private class MyScanner {
        String[] s;
        int i;
        BufferedReader br;
        String reg = " ";
        MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        public String next() {
            try {
                if (i < s.length) return s[i++];
                String line = br.readLine();
                while (line.equals("")) {line = br.readLine();}
                s = line.split(reg, 0);
                i = 0;return s[i++];
            } catch (Exception e) {e.printStackTrace();}
            return null;
        }
        public int nextInt() {
            try {return Integer.parseInt(next());} catch (Exception e) {e.printStackTrace();}
            return -1;
        }
        public double nextDouble() {
            try {return Double.parseDouble(next());} catch (Exception e) {e.printStackTrace();}
            return -1;
        }
        public long nextLong()  {
            try {return Long.parseLong(next());} catch (Exception e) {e.printStackTrace();}
            return -1;
        }
    }
}