jiahuimbzuai/CoQuIR huggingface dataset:
//  [javascript]
function main(s) {
	s = s.split("\n")[0].split(" ").map(x => Number(x));
	console.log(Math.max(0, Math.min(s[1],s[3])-Math.max(s[0],s[2])));
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
	var tmp = input.split(" ");
	var a = parseInt(tmp[0], 10);
	var b = parseInt(tmp[1], 10);
	var c = parseInt(tmp[2], 10);
	var d = parseInt(tmp[3], 10);
        if(b < c || d < a) {
            //   a   b   c  d
           console.log("%d", 0);
        } else if( a < c ) {
            if( b < d) { 
              //   a  c  b  d
              console.log("%d", b - c );
            }  else  {
             //  a  c  d   b 
              console.log("%d",  d - c);
           }
        } else {
           if( b < d) { 
              //  c a  b  d
              console.log("%d", b - a );
            }  else  {
             //  c a d  b 
              console.log("%d",  d - a);
           }
        }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input){
    var num = input.split(" ");
    for(var i=0; i<num.length; i++){
        num[i] = Number(num[i]);
    }
    if(num[0]<=num[2]){
        if(num[2]>=num[1]){
            console.log(0);
        }else if(num[1]<=num[3]){
            console.log(num[1]-num[2]);
        }else{
            console.log(num[3]-num[2]);
        }
    }else{
        if(num[0]>=num[3]){
            console.log(0);
        }else if(num[3]<=num[1]){
            console.log(num[3]-num[0]);
        }else{
            console.log(num[1]-num[0]);
        }
    }
}

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

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

var sc = bufio.NewScanner(os.Stdin)

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

func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}

func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	a, b := iScan(), iScan()
	c, d := iScan(), iScan()
	x := larger(a, c)
	y := smaller(b, d)
	fmt.Println(larger(0, y-x))
}
//  [go]
package main

import (
	"fmt"
	"math"
)

func main() {
	// Code for B - Two Switches
	var A, B, C, D int
	fmt.Scanf("%d %d %d %d", &A, &B, &C, &D)

	ans := math.Min(float64(B), float64(D)) - math.Max(float64(A), float64(C))
	if ans >= 0 {
		fmt.Println(ans)
	} else {
		fmt.Println("0")
	}
}
//  [ruby]
A,B,C,D=gets.split.map(&:to_i)
a=[A,C].max
b=[B,D].min
puts [b-a,0].max
//  [ruby]
a,b,c,d = gets.strip.split.map(&:to_i)
if b < c
  puts 0
  exit
end
if d < a
  puts 0
  exit
end
puts [b,d].min-[a,c].max
//  [ruby]
a,b,c,d = gets.chomp.split(" ").map(&:to_i)
arr = Array.new(101,0)
(a..b).each do |i|
  arr[i] += 1
end
(c..d).each do |i|
  arr[i] += 1
end
count = 0
st = []
arr.each_with_index do |o,j|
  if o == 2
    st << j
  end
end
if st.size >= 2
    puts st.pop - st.shift
else
    puts "0"
end
//  [rust]
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

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

#[fastout]
fn main() {
    input!{
        a: usize,
        b: usize,
        c: usize,
        d: usize,
    }

    println!("{}", max(0, min(b,d) as i64 - max(a,c) as i64));

}
//  [rust]
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars};
#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
	input! {
		a: usize,
		b: usize,
		c: usize,
		d: usize,
	}

	if b <= c {
		println!("0");
		return;
	}
	if d <= a {
		println!("0");
		return;
	}

	if a <= c {
		if b <= d {
			println!("{}", b-c);
			return;				
		}
		else {
			println!("{}", d-c);
			return;				
		}
	}
	else {
		if d <= b {
			println!("{}", d-a);
			return;				
		}
		else {
			println!("{}", b-a);
			return;				
		}
	}
}
//  [rust]
#[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 ! 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 ! 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 ) * } } ; }

fn main() {
    input! {
        a: i32,
        b: i32,
        c: i32,
        d: i32,
    }
    let begin = a.max(c);
    let end = b.min(d);
    println!("{}", (end - begin).max(0));
}
//  [swift]
print(readLine().map { line in 
    let l = line.split(separator: " ").compactMap { Int($0) }
    let (a, b, c, d) = (l[0], l[1], l[2], l[3])
    let left = max(a, c)
    let right = min(b, d)

    return max(0, right - left)
}!)
//  [swift]
extension Optional {
    func puts(){
        print(self!)
    }
}

readLine().map { line -> Int in 
    let l = line.split(separator: " ").compactMap { Int($0) }
    let (a, b, c, d) = (l[0], l[1], l[2], l[3])
    let left = max(a, c)
    let right = min(b, d)

    return max(0, right - left)
}.puts()
//  [typescript]
{
  const Main = input => {
    const [a,b,c,d] = input.split(" ").map(v => parseInt(v))
    const start = a < c ? c : a
    const end = b < d ? b : d


    if (end <= start) {
      console.log(0)
    } else {
      console.log(end - start)
    }
  };

  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [A, B, C, D] = input[0].map(Number);

  if (C > B || A > D) {
    return 0;
  }

  return Math.min(B, D) - Math.max(A, C);
};

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

reader.on("close", function () {
  const input = (lines[0] as string).split(" ");
  const alice = [Number(input[0]), Number(input[1])];
  const bob = [Number(input[2]), Number(input[3])];

  if (alice[0] > bob[1] || bob[0] > alice[1]) {
    console.log(0);
    return;
  }

  const a = alice[0] > bob[0] ? alice[0] : bob[0];

  const b = alice[1] < bob[1] ? alice[1] : bob[1];

  console.log(b - a);
});
//  [python]
import sys
import numpy as np

#n=int(sys.stdin.readline())
n,k=map(int,sys.stdin.readline().split())
#a=np.array(sys.stdin.readline().split(),dtype='int64')
#a=np.array([sys.stdin.readline().split() for i in range(n)],dtype='int64')

a=n%k
print(min(a,abs(k-a)))
//  [python]
import sys
import numpy as np
# for AtCoder
import fractions
from collections import deque 
from functools import reduce

n, k = map(int, input().split())

mi = n
mo = n % k

if mi > mo:
    mi = mo
if mi > abs(mo - k):
    mi = abs(mo - k)    
print(mi)
//  [python]
import sys
import itertools
import queue
import numpy as np
input = sys.stdin.readline
sys.setrecursionlimit(100000)
# mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


class V:
    def __init__(self, f, v=None):
        self.f = f
        self.v = v
 
    def __str__(self):
        return str(self.v)
 
    def ud(self, n):
        if n is None:
            return

        if self.v is None:
            self.v = n
            return
        self.v = self.f(self.v, n) 


def main():
    N, K = read_values()
    R = N % K
    print(min(R, K - R))

if __name__ == "__main__":
    main()
//  [java]
import java.util.*;
public class Main {

  public static void main(String[] args) { 
      Scanner sc = new Scanner(System.in);
      long n = sc.nextLong();
      long k = sc.nextLong();
      long res = n % k;
      res = Math.min(res, k - res);
      System.out.println(res);
  }
}
//  [cpp]
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
	long long n,m,ans=1e18;
	cin>>n>>m;
	n%=m;
	for(register int i=1;i<=1000000000;i++)
	{
		ans=min(ans,n);
		n=abs(n-m);
	}
	cout<<ans;
}
//  [c]
#include <stdio.h>

int main()
{
    unsigned long long int n, k;
    long long int tmp;
    int end;

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

    if (k == 1)
        n = 0;
    else {
        do {
            end = 0;
            if (n > 1000000000 * k) {
                n = n - 1000000000 * k;
                end = 1;
            }
        } while (end == 1);
        
        do {
            end = 0;
            tmp = (long long int)(n - k);
            if (tmp < 0)
                tmp *= -1;
            if (tmp < n) {
                n = (unsigned long long)tmp;
                end = 1;
            }
        } while (end == 1);
    }

    printf("%llu\n", n);

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

int main(void){
  long long n , k;
  scanf("%lld %lld",&n ,&k);

  long long ans = n%k;
  if(n%k > k - n%k){
    ans = k - n%k;
  }

  printf("%lld\n",ans);

  return 0;
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
int main(void){
  long long n,k;
  scanf("%lld%lld",&n,&k);
  if(n<k){
    long long m=llabs(n-k);
    if(n<m)printf("%lld",n);
    else printf("%lld",m);
  }
  else {
    if(n%k==0)
      printf("0");
    else {
      long long m=n%k;
      if(m<llabs(m-k))printf("%lld",m);
      else printf("%lld",llabs(m-k));
    }
  }
    return 0;
  }
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
    let [N, K] = lines[0].split(" ").map(v=>BigInt(v));
    const map = {};
    let ans = N;
    while(!map[N]){
        const a = N%K;
        map[a] = true;
        ans = ans>a?a:ans;
        N = K>a?K-a:a-K;
        if(ans==0)break;
    }
    console.log(ans.toString());
    
});
//  [javascript]
const input = require("fs").readFileSync("/dev/stdin", "utf8")
const lines = input.split('\n')
const [N, K] = lines[0].split(' ').map(BigInt)
let ans = N % K
ans = ans < - (ans - K) ? ans : - (ans - K)
console.log(ans.toString())
//  [go]
package main

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

func main() {

	nextReader = newScanner()

	n, k := nextInt(), nextInt()

	t := n % k
	min := t

	for i := 0; i < 100000000; i++ {
		t = abs(t - k)

		if t < min {
			min = t
			if min == 0 {
				break
			}
		}

	}

	fmt.Println(min)

}

/* --------------------------------------------------------------------------
 *  std.io
 * ------------------------------------------------------------------------- */
var nextReader func() string

func newScanner() func() string {
	r := bufio.NewScanner(os.Stdin)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)
	return func() string {
		r.Scan()
		return r.Text()
	}
}
func nextString() string {
	return nextReader()
}
func nextInt64() int64 {
	v, _ := strconv.ParseInt(nextReader(), 10, 64)
	return v
}
func nextInt() int {
	v, _ := strconv.Atoi(nextReader())
	return v
}
func nextInts(n int) []int {
	r := make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}
func nextInt64s(n int) []int64 {
	r := make([]int64, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt64()
	}
	return r
}
func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(nextReader(), 64)
	return f
}

func maxInt(a, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}

func max(a, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}

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

func mins(t ...int) int {
	if len(t) == 0 {
		return 0
	}

	min := t[0]
	for i := 1; i < len(t); i++ {
		if min > t[i] {
			min = t[i]
		}
	}
	return min
}

func abs(a int) int {
	if a >= 0 {
		return a
	} else {
		return 0 - a
	}
}
//  [go]
package main

import (
	"fmt"
	"math"
)

func main() {
	var N, K int
	fmt.Scan(&N, &K)
	if K == 1 {
		fmt.Println(0)
		return
	}
	x := N
	min := math.MaxInt64
	for i := 0; i < 1000000; i++ {
		x = Min(x%K, Abs(x-K))
		min = Min(min, x)
	}
	fmt.Println(min)
}
func Min(a, b int) int {
	if b < a {
		return b
	}
	return a
}
func Abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
//  [go]
package main
 
import (
	"fmt"
)

var N, K int64
func main() {
	fmt.Scan(&N, &K)
	a := N % K
	b := K - a
	if a > b {
      fmt.Println(b)
	} else {
      fmt.Println(a)
	}
}
//  [ruby]
eval"N,K="+`tr \\  ,`;p [N%=K,K-N].min
//  [ruby]
require 'set'; require 'prime'
INF=Float::INFINITY; MOD=10**9+7
n,k = gets.chomp.split.map(&:to_i)
s = Set.new

n -= (n / k) * k
ans = n
until s.include? n
  s.add n
  n = (n-k).abs
  ans = n if ans > n
end

puts ans
//  [ruby]
# c
require 'pp'
x, k = gets.split.map(&:to_i)

# x >>> k
if x > k

  x2 = x % k

  if x2 == 0
    p 0
    exit
  end

  # x2 < k
  x3 = k % x2
  p x3
else # x <= k
  if k - x > x
    p x
  else
    x2 = k - x
    p x2
  end
end

# 1 2 0
//  [rust]
#![allow(
    non_snake_case,
    unused_variables,
    unused_assignments,
    unused_mut,
    dead_code
)]
//use permutohedron::LexicalPermutation as _;
use proconio::input;
//use proconio::marker::Chars;
//use proconio::marker::Usize1;
//use std::collections::HashSet;
//use std::collections::HashMap;
//use std::collections::BTreeMap;
use std::cmp::*;
//use std::num;

fn main() {
    input! {
         n:i64,k:i64

    }
    let x = n % k;
    let y = k - x;
    let ans = min(x, y);
    println!("{}", ans);
}
//  [rust]

use proconio::input;
use std::cmp::min;
fn main() {
    /*     input! {
        n: usize,
        mut plan: [(i32, i32, i32); n],  // Vec<(i32, i32, i32)>
    }
 */
    input! {
        n:isize,
        k:isize
    }

    let mut ans = n % k;
    ans = min(ans,(ans - k).abs());
    

    println!("{}",ans);


}
//  [swift]
import Foundation

let input = readLine()!.componentsSeparatedByString(" ").map{ Int($0)! }

let mod = input[0] % input[1]
let min = abs(mod - input[1])
if(mod >= min){
  print(min)
}else{
  print(mod)
}
//  [swift]
import Foundation

let input = readLine()!

let info = input.componentsSeparatedByString(" ")

let val = Int64(info[0])!
let divider = Int64(info[1])!
let mod1 = val % divider
let mod2 = abs(mod1 - divider)

print(min(mod1, mod2))
//  [swift]
import Foundation

let inputLine = readLine()!.components(separatedBy: " ").map({Int($0)!})
let N = inputLine[0]
let K = inputLine[1]

var ans = N

func swapAbs() {
    if abs(ans-K)>ans{
        return
    }
    ans = abs(ans-K)
    swapAbs()
}

let div = N/K
ans = N-K*div
swapAbs()
print(ans)
//  [python]
import numpy as np


def main():
    S = input()
    ret = 0
    for i in range(len(S) // 2):
        if S[i] != S[len(S)-i-1]:
            ret += 1

    print(ret)


if __name__ == '__main__':
    main()
//  [python]
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/
#
# lang: Python3 (3.4.3)

import math
import statistics
import numpy as np
import queue

s = input()
cnt = 0

for i in range(len(s) // 2):
  if s[i] != s[len(s) - 1 - i]:
    cnt += 1

print(cnt)
//  [python]
import sys
from math import factorial
from fractions import Fraction
import heapq, bisect
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
MOD = 10**9 + 7

s = input()
n = len(s)//2

res = 0
for i in range(n):
    if s[i] != s[-1*(i+1)]:
        res += 1

print(res)
//  [java]
import java.io.InputStream;
import java.util.Scanner;
import java.util.stream.*;

public class Main {
  public static void main(String[] args){
    System.out.println(new Main().excute(System.in)); 
  }
  public String excute(InputStream f) {
    Scanner scan = new Scanner(f);
    String[] s =  scan.next().split("");

    return "" + IntStream.range(0, s.length/2)
                .filter(i -> !(s[i].equals(s[s.length-i-1])))
                .count();
  }
}
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.regex.Pattern;

public class Main {
    public void solve(Stdin stdin, PrintWriter stdout) throws NumberFormatException, IOException {
        String s = stdin.next();
        int ans = 0;
        for (int i = 0, len = s.length(); i < len / 2; i++) {
            char c1 = s.charAt(i);
            char c2 = s.charAt(len - i - 1);
            if (c1 != c2) {
                ans++;
            }
        }
        stdout.println(ans);
    }

    public static void main(String[] args) throws NumberFormatException, IOException {
        Stdin stdin = new Stdin();
        PrintWriter stdout = new PrintWriter(System.out, false);
        new Main().solve(stdin, stdout);
        stdout.flush();
    }

    public static class Stdin {
        private Deque<String> queue;
        private BufferedReader stdin;
        private Pattern delimiter;

        public Stdin() {
            queue = new ArrayDeque<>();
            stdin = new BufferedReader(new InputStreamReader(System.in));
            delimiter = Pattern.compile(" ");
        }

        public String next() throws IOException {
            if (queue.isEmpty()) {
                delimiter.splitAsStream(stdin.readLine()).forEach(queue::addLast);
            }
            return queue.removeFirst();
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }
    }
}
//  [java]
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String[] sArray = new String[s.length()];

		for (int i = 0; i < s.length(); i++) {
			sArray[i] = String.valueOf(s.charAt(i));
		}

		int count = 0;
		int sLength = s.length();

		for (int i = 0; i < sLength / 2; i++) {
			if (!sArray[i].equals(sArray[sLength - (i + 1)])) {
				count++;
			}
		}

		System.out.print(count);

	}

}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

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

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

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

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

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

ll T=1;
ll n,x,y,m;
string s,t;
vll a;
// <------------- Implement Functions Here ----------> //



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

void MAIN() {
	cin>>s;
	ll l=0, r = s.length()-1;
	ll cou = 0;
	while(l<r) {
		cou+=(s[l] != s[r]);
		l++;
		r--;
	}
	cout<<cou;
}

int main() {
	fastio;randomINT;
	//cin>>T;
	while(T--) {
		MAIN();
	}
	return 0;
}
//  [cpp]
#include <bits/stdc++.h>
#include <boost/foreach.hpp>
using namespace std;
#define pi 2*asin(1.0)
#define MAX 10000000
#define MOD 1000000007
#define _GLIBCXX_DEBUG
 
vector<long> fac(MAX);
vector<long> finv(MAX);
vector<long> inv(MAX);
 
//template functions
/////////////////////////
void Cominit(){
  fac.at(0)=fac.at(1)=1;
  finv.at(0)=finv.at(1)=1;
  inv.at(1)=1;
  for(long i=2;i<MAX;i++){
      fac.at(i)=(fac.at(i-1)*i)%MOD;
      inv.at(i)=MOD-inv.at(MOD%i)*(MOD/i)%MOD;
      finv.at(i)=finv.at(i-1)*inv.at(i)%MOD;
  }
}

long facComb(long N,long M){// nCm%
if(N<M) return 0;
if(N<0||M<0) return 0;
return fac.at(N)*(finv.at(M)*finv.at(N-M)%MOD)%MOD;
}

long Comb(long N,long M){// nCm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
for(long i=M;i>0;i--){
    ans=ans/i;
}
return ans;
}

long Perm(long N,long M){// nPm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
return ans;
}

long GCM(long A,long B){
            long W,r;
    if(A<B){

        W=B;
        B=A;
        A=W;
    }
    while(A%B!=0){
        r=A%B;
        A=B;
        B=r;
    }
    return B;
}
long LCM(long A,long B){
    return (A*B)/GCM(A,B);
}

long upDiv(long a,long b){
  return (a+b-1)/b;
}

long strtolong(string str){
istringstream ss;
ss=istringstream(str);
long num;
ss>>num;
return num;
}

long chartolong(char ch){
long num;
num=ch-'0';
return num;
}

string longtostr(long N){
    string str;
    str=to_string(N);
    return str;
}









/////////////////////////


//Answer


int main() {

string S;
cin>>S;
long ans=0;
for(long i=0;i<(S.size())/2;i++){
if(S.at(i)!=S.at(S.size()-1-i)){
    ans++;
}
}
cout<<ans<<endl;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <stdbool.h>

#define rep(i, n) for(int i=0; i<(n); ++i)
#define max  200001

//qsort(str, n, sizeof(int), up_comp);
int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;}
int int_sort( const void * a , const void * b ) {return strcmp(( char * )a , ( char * )b );}
int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;}
int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);}

int main(void){
 
    int len, cnt=0;
    char s[max];
    
    scanf("%s", s);
    
    len=strlen(s);
    
    rep(i, len/2){
        if (s[i]!=s[len-i-1]) {
            cnt++;
        }
    }
    
    printf("%d", cnt);
    
    return 0;
}
//  [c]
a;main(t,s)char*s,*t;{for(gets(s),t=s+strlen(s);s<--t;)a+=*s++!=*t;printf("%d",a);}
//  [c]
#include<stdio.h>
#include<string.h>
int main()
{
	char s[100];
	int a,i,c=0;
	scanf("%s",s);
	a=strlen(s);
	for(i=0;i<a/2;i++){
		if(s[i]!=s[a-1-i]) c++;
	}
	printf("%d\n",c);
	return 0;
}
//  [javascript]


function Main(input) {
  input = input.split("\n");
  var S = input[0].split("");
  var ans=0;
  for(var i=0;i<Math.floor(S.length/2);i++){
    if(S[i]!=S[S.length-1-i]){
      ans++;
    }
  }

  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const S = arg[0].split("");
    const Srev = arg[0].split("").reverse();
    
    let diff = 0;
    
    for(let i in S) {
        if(S[i] !== Srev[i]) diff++;
    }
    
    // console.log(S);
    // console.log(Srev);
    
    console.log(diff / 2)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
"use strict";
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

console.log(main());
function main(){
  var s = o.a(1);
  var ans = 0;
  var l = s.length
  for(var i = 0; i < l >> 1; i++){
    if(s[i] !== s[l-1-i])ans++;
  }
  return ans;
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
)

func main()  {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	S := scanner.Text()

	counter := 0

	for i:=0; i < int(math.Floor(float64(len(S) / 2))); i++ {
		if(S[i:i+1] != S[len(S)-(i+1):len(S)-i]) {
			counter++
		}
	}

	fmt.Println(counter)
}
//  [ruby]
S = gets.strip.to_s
M = S.size
cnt = 0
if M%2==0 then
  (0..M/2-1).each do |i|
    if S[i]!=S[M-1-i] then
      cnt += 1
    end
  end
  puts cnt
else
  (0..(M-3)/2).each do |i|
    if S[i]!=S[M-1-i] then
      cnt += 1
    end
  end
  puts cnt
end
//  [ruby]
s1 = gets.chomp
s2 = s1.reverse
len = s1.length/2

ans = 0

len.times do |i|
  ans += 1 if s1[i] != s2[i]
end

puts ans
//  [ruby]
s=gets.chomp
t=s.reverse
c=0
s.size.times do |i|
  c+=1 if s[i]!=t[i]
end
p c/2
//  [rust]
#[allow(unused_imports)]
use std::cmp::{Ordering};

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Write};

#[allow(unused_imports)]
use std::iter::FromIterator;

#[allow(unused_macros)]
macro_rules! min {
    ($x: expr) => ($x);
    ($x: expr, $($z: expr),+) => {{
        std::cmp::min($x, min!($($z),*))
    }}
}

#[allow(unused_macros)]
macro_rules! max {
    ($x: expr) => ($x);
    ($x: expr, $($z: expr),+) => {{
        std::cmp::max($x, max!($($z),*))
    }}
}

#[allow(unused_macros)]
macro_rules! get { 
    ([$t: ty]) => { 
        { 
            let mut line = String::new(); 
            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<_>>()
    };
    ($t: ty) => {
        {
            let mut line = String::new();
            stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t: ty),*) => {
        { 
            let mut line = String::new();
            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<_>>()
    };
}

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

const BIG_STACK_SIZE: bool = true;

#[allow(dead_code)]
fn main() {
    use std::thread;
    if BIG_STACK_SIZE {
        thread::Builder::new()
            .stack_size(32 * 1024 * 1024)
            .name("solve".into())
            .spawn(solve)
            .unwrap()
            .join()
            .unwrap();
    } else {
        solve();
    }
}

fn solve() {
    let s = get!(String).chars().collect::<Vec<_>>();
    let n = s.len();
    let mut count = 0usize;
    for i in 0..n/2 {
        if s[i] != s[n-i-1] {
            count += 1;
        }
    }
    println!("{}", count);
}
//  [rust]
fn input_one<T: std::str::FromStr> () -> Result<T, T::Err> {
    let mut n = String::new();
    std::io::stdin().read_line(&mut n).unwrap();
    n.trim().parse()
}

fn main() {
    let s: String = input_one().unwrap();
    let chars: Vec<_> = s.chars().collect();
    let charlen = chars.len();
    let mut result = 0;
    for i in 0..(charlen / 2) {
        if chars[i] != chars[charlen - i - 1] {
            result += 1;
        }
    }
    println!("{}", result);
}
//  [typescript]
export class Main {
  static main(input: string): string {
    const tmp: string[] = input.split("\n");
    const s = tmp.shift();

    const l = s.length % 2 === 0 ? s.length / 2 : (s.length - 1) / 2;
    
    let hugs = 0;
    for (let i = 0; i < l; i++) {
      if(s[i] !== s[s.length - 1 - i]) {
        hugs += 1;
      } 
    }

    return `${hugs}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));
//  [typescript]

function Main(input: string) {

    let input1 = input.split('\n')[0];
    let sLength: number = input1.length;

    let forward: Array<string> = []
    let back: Array<string> = []

    if (sLength % 2 === 0) {
        forward = input1.split('').slice(0, sLength / 2)
        back = input1.split('').slice(sLength / 2).reverse();
    } else {
        forward = input1.split('').slice(0, Math.floor(sLength / 2))
        back = input1.split('').slice(Math.floor(sLength / 2) + 1).reverse();
    }


    let count: number = forward.filter((v, i) => {
        return back[i] !== v;
    }).length

    console.log(count)

}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
{
  const main = (input: string) => {
    const r = reader(input)
    const S = r.s()

    const sl = Math.floor(S.length / 2)
    // 7 => 0 1 2 [3] 4 5 6 => 3
    // 6 => 0 1 2 [] 3 4 5

    let res = 0

    for (let i = 0; i < sl; i++) {
      // console.log(S[i], S[S.length - i - 1])
      if (S[i] !== S[S.length - i - 1]) {
        res++
      }
    }
    console.log(res)
  }

  const reader = (str: string) => {
    const lines = str.trim().split('\n')
    const s = () => lines.shift() || ''
    const n = () => Number(s())

    const ss = () => s().split(' ')
    const ns = () => ss().map(Number)
    const nls = () => lines.map(Number)

    return { lines, s, n, ss, ns, nls }
  }

  const getInput = () => require('fs').readFileSync('/dev/stdin', 'utf8')

  main(getInput())
}
//  [python]
n=int(input())
s,t=input().split()
for i in range(n):
    print(s[i],end='')
    print(t[i],end='')
//  [python]
import itertools
import math
import fractions
import functools

n = int(input())
s, t  = input().split()

for i in range(n):
    print(s[i]+t[i],end="")
print("")
//  [python]
from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
from fractions import gcd
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())


n = int(input())
s, t = input().split(" ")
ans_s = str()
for i in range(n):
    ans_s += s[i]
    ans_s += t[i]

print(ans_s)
//  [java]
import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.stream.Collectors;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
public class Main {
	public static void main(final String[] args){
    
    Scanner sc = new Scanner(System.in);
    List<Character> list1 = new ArrayList<>();

    int n = sc.nextInt();
    String s = sc.next();
    String t = sc.next();

    for(int i = 0; i < n ; i++){
        list1.add(s.charAt(i));
        list1.add(t.charAt(i));
    }

    List<String> change = list1.stream().map(e -> String.valueOf(e)).collect(Collectors.toList());
    //System.out.println(list1);
    //System.out.println(String.join("",change));
    System.out.println(String.join("", change));


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

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

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String s = sc.next();
		String t = sc.next();
		String sum = "";
		for(int i = 0 ; i < n ; i++) {
			sum += "" + s.charAt(i) + t.charAt(i);
		}

		sc.close();
		System.out.println(sum);

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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] s = sc.next().split("");
        String[] t = sc.next().split("");

        List<String> result = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            result.add(s[i]);
            result.add(t[i]);
        }
        result.forEach(System.out::print);
    }
}
//  [cpp]
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define ll long long

typedef tree< pair<int,int>, null_type, less< pair<int,int> >, rb_tree_tag, tree_order_statistics_node_update>Order_Set;

Order_Set X;

const int mxn = 1e7+100;
const int Mod = 1e9+7;

int arr[mxn], qs[mxn];
int bitOn[55];
map<int,int>Mp, cnt, op;
vector< pair<int, pair<int,int> > >Pi, Ans;
vector<int>G[mxn];
set<int>seet[mxn];

int main()
{
     ios::sync_with_stdio(false);

     int n;
     cin>>n;
     string str1, str2;
     cin>>str1>>str2;
     string Ans = "";
     for(int i=0 ; i<n ; i++) Ans+=str1[i], Ans+=str2[i];
     cout<<Ans<<endl;

     return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <time.h>
int main(){
    int n,i;
    char s[100]={},t[100]={},ans[220]={};
    scanf("%d %s %s",&n,s,t);
    for(i=0; i<n; i++){
        ans[2*i]=s[i];
        ans[2*i+1]=t[i];
    }
    printf("%s",ans);
    return 0;
}
//  [c]
#include<stdio.h>
int main(void){
    int n;
    int i = 0;
    char s[105];
    char t[105];
    scanf("%d",&n);
    scanf("%s%s",s,t);
    while (i < n)
    {
        printf("%c%c",s[i],t[i]);  
        i++;
    }
    
    return 0;
}
//  [c]
#include <stdio.h>
int main(){
  int	n;
  char	s[100+1]={0};
  char	t[100+1]={0};
  
  scanf("%d", &n);
  scanf("%s %s", s, t);
  for(int i=0; i<n; i++){ printf("%c%c", s[i], t[i]); }
  return 0;
}
//  [javascript]
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]param
//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i,no){switch(no){case 0:return i;case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));}}
function Main(input) {
  input = myconv(input,3);
  var N = myconv(input[0],1);
  var S = myconv(input[1],2)[0];
  var T = myconv(input[1],2)[1];
  var output = "";
  for(var i = 0; i < N; i++){
    output += S[i] + T[i];
  }
  myout(output);
}
Main(myin());
//  [javascript]
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0]);
    const S = (arg[1].split(" ")[0]);
    const T = (arg[1].split(" ")[1]);
    
    let answer = [];
    
    for(let i=0; i<N; i++) {
        answer.push(S[i]);
        answer.push(T[i]);
    }
    
    console.log(answer.join(""));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
  var a = lines[0]
  var characters = lines[1].split(" ").map(x => x.split(""))
  var new_ary = []
  for(var i = 0; i < a; i++) {
    new_ary.push(characters[0][i])
    new_ary.push(characters[1][i])
  }
  console.log(new_ary.join(""))
});
//  [go]
package main

import (
	"bufio"
	"container/list"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

const (
	BUFSIZE   = 10000000
	MOD       = 1000000007
	INF_INT   = math.MaxInt32
	INF_INT64 = math.MaxInt64
)

var rdr *bufio.Reader

func main() {
	rdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)
	solve()
}

func solve() {
	N := readint()
	var S, T string
	fmt.Scanf("%s %s", &S, &T)
	row := strings.Split(readline(), " ")
	S = row[0]
	T = row[1]
	ans := list.New()

	for i := 0; i < N; i++ {
		ans.PushBack(string(S[i]))
		ans.PushBack(string(T[i]))
	}

	for e := ans.Front(); e != nil; e = e.Next() {
		fmt.Print(e.Value)
	}
	fmt.Println()
}

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

func readIntSlice(size int) []int {
	slice := make([]int, size)
	lines := strings.Split(readline(), " ")
	for i, v := range lines {
		slice[i] = s2i(v)
	}
	return slice
}

func readInt64Slice(size int) []int64 {
	slice := make([]int64, size)
	lines := strings.Split(readline(), " ")
	for i, v := range lines {
		slice[i] = s2i64(v)
	}
	return slice
}

func readint() int {
	return s2i(readline())
}

func readint64() int64 {
	return s2i64(readline())
}

// For int64
func b2i64(b bool) int64 {
	if b {
		return 1
	}
	return 0
}

func abs64(v int64) int64 {
	if v < 0 {
		return -v
	}
	return v
}

func min64(values ...int64) int64 {
	ret := int64(INF_INT64)
	for _, v := range values {
		if ret > v {
			ret = v
		}
	}
	return ret
}

func max64(values ...int64) int64 {
	ret := -int64(INF_INT64)
	for _, v := range values {
		if ret < v {
			ret = v
		}
	}
	return ret
}

func s2i64(s string) int64 {
	v, ok := strconv.ParseInt(s, 10, 64)
	if ok != nil {
		panic("Faild : " + s + " can't convert to int64")
	}
	return v
}

// For int
func b2i(b bool) int {
	if b {
		return 1
	}
	return 0
}

func abs(v int) int {
	if v < 0 {
		return -v
	}
	return v
}

func min(values ...int) int {
	ret := INF_INT
	for _, v := range values {
		if ret > v {
			ret = v
		}
	}
	return ret
}

func max(values ...int) int {
	ret := -INF_INT
	for _, v := range values {
		if ret < v {
			ret = v
		}
	}
	return ret
}

func s2i(s string) int {
	v, ok := strconv.Atoi(s)
	if ok != nil {
		panic("Faild : " + s + " can't convert to int")
	}
	return v
}

/* ------------------------------------------------ */
/* Data stracture                                   */
/* ------------------------------------------------ */
type IntHeap []int

func (h *IntHeap) Push(x interface{}) {
	*h = append(*h, x.(int))
}

func (h *IntHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

func (h IntHeap) Len() int           { return len(h) }
func (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }
func (h IntHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}

func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	_ = iScan()
	s := Scan()
	t := Scan()
	for i, _ := range s {
		fmt.Print(string(s[i]))
		fmt.Print(string(t[i]))
	}
	fmt.Println("")
}
//  [ruby]
_,s,t=`dd`.split.map{|s|s.split ''}
puts s.zip(t).flatten.join
//  [ruby]
_,s,t=`dd`.split
s=s.split('')
t=t.split('')
puts s.zip(t).flatten.join
//  [ruby]
n = gets.to_i
s, t = gets.split.map(&:chomp)

n.times do |i|
  print s[i]
  print t[i]
end
//  [rust]
fn input_one<T: std::str::FromStr> () -> Result<T, T::Err> {
    let mut n = String::new();
    std::io::stdin().read_line(&mut n).unwrap();
    n.trim().parse()
}

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

fn main() {
    let n: usize = input_one().unwrap();
    let a: Vec<String> = input_arr();
    println!("{}", a[0].chars().zip(a[1].chars()).flat_map(|(a, b)| vec![a, b]).collect::<String>());
}
//  [rust]
use proconio::marker::Chars;
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        n: usize,
        s: Chars,
        t: Chars,
    }
    println!(
        "{}",
        (0..2 * n)
            .map(|i| if i % 2 == 0 { s[i / 2] } else { t[(i - 1) / 2] })
            .collect::<String>()
    );
}
//  [swift]

import Foundation

func main(){
   let n = Int(readLine()!)!
   let line = readLine()!.split(separator: " ")
   
   let s = Array(line[0])
   let t = Array(line[1])
   
   var answer = ""
   for i in 0..<n {
      answer += "\(s[i])\(t[i])"
   }
   print(answer)
}
main()
//  [typescript]
import * as fs from 'fs';

const lines = fs.readFileSync('/dev/stdin', 'utf-8').trim().split('\n');
const [s, t] = lines[1].split(' ');

let result = '';
for (const [x, y] of zip(s, t)) {
  result += x + y;
}
console.log(result);

function* zip(xs: string, ys: string) {
  const len = Math.min(xs.length, ys.length);
  for (let i = 0; i < len; i++) {
    yield [xs[i], ys[i]] as const;
  }
}
//  [typescript]
"use strict";

const main = arg => {
  const input = arg.trim().split("\n");
  const N = parseInt(input[0]);
  const S1 = input[1].split(" ")[0];
  const S2 = input[1].split(" ")[1];
  let s = "";
  for (let i = 0; i < N; i ++ ) {
    s  = s + S1.substring(i, i + 1);
    s  = s + S2.substring(i, i + 1);
  }
  console.log(s);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
'use strict'
const main = (input: string) => {
    const std: string[] = input.split('\n')
    const n: number = ~~std.shift()
    const sArray: string[] = std.shift().split(' ')
    const s: string[] = sArray.shift().split('')
    const t: string[] = sArray.shift().split('')
    let result: string[] = []
    for (let i = 0; i < n; i++) {
      result.push(s[i])
      result.push(t[i])
    }
    console.log(result.join(''))
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim())
//  [python]
h,w = map(int,input().split())

p = []
for i in range(0,h):
  s = input()
  p.append(s)
for i in range(0,h):
  print(p[i])
  print(p[i])
//  [python]
h,w = map(int, input().split())
c = [input() for i in range(h)]
for i in c:
    print(i)
    print(i)
//  [python]
h,w=map(int,input().split())
for i in range(h):
  s=input()
  print(s)
  print(s)
//  [python]
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import string
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

H, W = list(map(int, sys.stdin.readline().split()))
C = [sys.stdin.readline().rstrip() for _ in range(H)]

for r in C:
    print(r)
    print(r)
//  [python]
import numpy as np
from sys import stdin


def main():
    h = next_int()
    w = next_int()

    c = np.array([input() for _ in range(h)])

    for i in range(h):
        for j in range(2):
            print(c[i])


def next_int() -> int:
    return int(next_str())


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()
//  [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 input =new BufferedReader(new InputStreamReader(System.in));
        String[] firstLine = input.readLine().split(" ");
        int H = Integer.parseInt(firstLine[0]);
        int W = Integer.parseInt(firstLine[1]);

        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < H; i++) {
            String line = input.readLine();
            if (i == 0) {
                builder.append(line);
                builder.append("\n");
                builder.append(line);
            } else {
                builder.append("\n");
                builder.append(line);
                builder.append("\n");
                builder.append(line);
            }

        }

        System.out.println(builder.toString());

    }
}