// https://codeforces.com/problemset/problem/977/B
// Big O:
// Time complexity: O(n)
// Space complexity: O(n)

const readline = require("readline");

// Read input
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let stringLength;
rl.on('line', (input) => {
    if (stringLength) {
        console.log(findMostCommonGram(input, stringLength));
        rl.close();
    } else {
        stringLength = input;
    }
});

// Problem
function findMostCommonGram(string, stringLength) {
    let mostCommonGram = "";
    let mostCommonGramOccurrences = 0;
    const gramOccurrences = {};

    for (let i = 0; i < stringLength - 1; i++) {
        const twogram = string[i] + string[i + 1];
        const occurrences = gramOccurrences[twogram] ? gramOccurrences[twogram] + 1 : 1;
        const currentOcurrences = occurrences + 1;
        if (currentOcurrences > mostCommonGramOccurrences) {
            mostCommonGram = twogram;
            mostCommonGramOccurrences = currentOcurrences;
        }

        gramOccurrences[twogram] = currentOcurrences;
    }

    return mostCommonGram;
}

// http://codeforces.com/contest/977/problem/B

var arg1 = readline();
var arg2 = readline();

var length = parseInt(arg1);
var string = arg2;

function main(length, string) {
    var hash = {};

    for (var i = 0; i < length - 1; i++) {
        var substring = `${string[i]}${string[i + 1]}`;
        if (hash[substring]) {
            hash[substring] = hash[substring] + 1;
        } else {
            hash[substring] = 1;
        }
    }

    var twogrammaList = Object.keys(hash);
    var biggest = twogrammaList[0];

    for (var j = 1; j < twogrammaList.length; j++) {
        var tg = twogrammaList[j];

        if (hash[tg] > hash[biggest]) {
            biggest = twogrammaList[j];
        }
    }

    return biggest;
}

print(main(length, string));

var n = parseInt(readline());
var s = readline();
var twoGram;
var testTwoGram;
var counter = 0;
var tempCounter = 0;
var result;
var x;
var y;

for(var i = 0; i < n - 1; i++)
{
    x = s[i];
    y = s[i + 1];
    twoGram = x + y;

    for(var j = 0; j < n - 1; j++)
    {
        x = s[j];
        y = s[j + 1];

        testTwoGram = x + y;

        if(testTwoGram == twoGram)
            tempCounter++;
    }
    if(tempCounter > counter)
    {
        result = twoGram;
        counter = tempCounter;
    }
    tempCounter = 0;
}

print(result);

var n = +readline();
var s = readline();
var mx = 0, id = 0;
for(var i = 0; i < n-1; i ++){
    var cnt = 0;
    for(var j = 0; j < n-1; j ++){
        if(s[i] == s[j] && s[i+1] == s[j+1]){
            cnt ++;
        }
    }
    if(cnt > mx){
        mx = cnt;
        id = i;
    }
}
var res = s[id] + s[id+1];
print(res);

var n = readline(), str = readline().split('');
var cnt = new Map();
var ans = str[0] + str[1], max = 1;
for(var i = 0; i < str.length - 1; i++) {
    var tp = str[i] + str[i + 1];
    if(cnt.has(tp)) {
        cnt.set(tp, cnt.get(tp) + 1);
        if(max < cnt.get(tp)) {
            max = cnt.get(tp);
            ans = tp;
        }
    }
    else {
        cnt.set(tp, 1);
    }
}
print(ans);

var t = Number(readline());
var str = readline().split('');
var arr = [];
str.forEach((cur, i) => {
    arr.push(str.slice(i,i+2).join(''));
});
var obj= {}, maxEl, maxCount = 0;
arr.forEach((cur, i) => {
    if(!obj[cur]){
        obj[cur] = 1;
    }else{
      obj[cur]++;
    }

    if(obj[cur] > maxCount){
        maxCount = obj[cur];
        maxEl = cur;
    }
});

print(maxEl);

var n = readline().split(" ").map(function(x) { return parseInt(x); });
var input = readline();

var k = 0;
var out = "";
var maxK = -1;

for(var i = 0; i < n - 1; i++) {
	var str1 = input.substr(i,2);
	k = 0;
	for(var j = 0; j < n - 1; j++){
		var str2 = input.substr(j,2);
		if(str2 == str1)
			k++;
	}
	if(maxK < (k-1)) {
		maxK = k - 1;
		out = str1;
	}
}

print(out);

var uselessLine = readline();
var input = readline();

var splitted = input.split('');
var maximal = 0;
var twogram = '';

function check(str,currentTwogram) {
    var n = 0;
    for(var j = 0; j<str.length;j++) {
        if(str[j] + str[j+1] == current){
            n++;
        }
    }

    return n;
}

for(var i= 0; i< splitted.length; i++) {

    var current = splitted[i] + splitted[i+1];

    var numOccurr = check(splitted, current);

    if(numOccurr > maximal) {
        maximal = numOccurr;
        twogram = current;
    }
}

print(twogram)

var n = readline();
var s = readline();

var map = {};

for (var i = 0; i < n - 1; i++) {
    var d = s[i] + s[i+1];
    map[d] === undefined ? map[d] = 1 : map[d]++;
}
var max = 0;
var ans = "";
Object.keys(map).map(function(key) {
    if (map[key] > max ) {
        ans = key;
        max = map[key];
    }
});

print(ans);

let i = '';

process.stdin.on('data', c => i += c);
process.stdin.on('end', function(data) {
    const {EOL} = require('os')
    const [length, input] = i.split(EOL);
    const n = parseInt(length);
    const s = input.trim();
    console.log(getTwoGrams(n, s));
})

function getTwoGrams(n, s) {
  let max = 0;
  let pair;
  let i = 0;
  let sub = s.substring(i, i+2);

  function getReducer(matches) {
    return (carry, match, index) => {
      carry = carry + (matches[index].length - 1);
      return carry;
    };
  }

  while (sub.length === 2) {
    const regex = sub[0] == sub[1] ? `${sub}+` : `${sub}`;

    const matches = s.match(new RegExp(regex, 'g'));
    const occurances = matches.reduce(getReducer(matches), 0);

    if (max <= occurances) {
      max = occurances;
      pair = sub;
    }
    i++;
    sub = s.substring(i, i+2);
  }

  return pair;
}

process.stdin.resume()
process.stdin.setEncoding('utf-8')

var arr = ''
process.stdin.on('data', (i) => {
  arr += i
})

process.stdin.on('end', () => {
  arr = arr.split('\n')
  const n = parseInt(arr[0])
  const a = arr[1]
  const map = {}
  for(let i = 1; i < n; i ++) {
    var key = a[i - 1] + a[i]
    if(!map[key]) map[key] = 1
    else map[key] = map[key] + 1
  }

  var max = 0
  var maxK = ''
  for(let i in map) {
    if(map[i] > max) {
      max = map[i]
      maxK = i
    }
  }
  console.log(maxK)

})

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let stdinInput = '';

process.stdin.on('data', input => {
  stdinInput += input;
})

process.stdin.on('end', () => {
  main(stdinInput);
})

function main(data) {
    data = data.split(/\r?\n/);
    const testCases = data[0] * 1;

    solve(data[1], testCases)
}

function solve(line, length) {
    let map = {}
    let i;
    for(i = 0; i < length - 1; i++) {
        let twogram = line.substring(i, i + 2)
        map[twogram] = twogram in map ? map[twogram] + 1 : 1
    }

    let maxtg = ""
    let curMax = 0
    let keys = Object.keys(map)
    keys.forEach( key =>
        {
            if (map[key] > curMax) {
                curMax = map[key]
                maxtg = key
            }
        }
    )
    console.log(maxtg)
}

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let standardInputString= '';
let currentLine = 0;

function readLine(){
  return standardInputString[currentLine++];
}

process.stdin.on('data', rawData =>{
  standardInputString += rawData;
});

process.stdin.on('end', _ =>{
  standardInputString= standardInputString.trim().split('\n').map(line =>{
    return line.trim();
  });

  main();
})

function main(){

  //first line in input
  let [n] = readLine().split(' ').map(Number);

  let line = readLine().split('');
  let prev = 0;

  let result = '';
  for(let i = 0; i<line.length; i++){
    let counter = 0;
    for(let j  =0; j<line.length; j++){
      if(line[i] === line[j] && line[i+1] === line[j+1]){
        counter++;
      }
    }
    if(counter > prev){
      prev = counter;
      result = line[i] + line[i+1];
    }
  }
  console.log(result);

}

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let c = 0;

rl.on('line', (str) => {
  if (c === 0) {
    c++;
    return;
  }

  const obj = {};

  for (let i = 0; i < str.length - 1; i++) {
    let pair = str[i] + str[i + 1];

    if (obj[pair]) {
      obj[pair]++;
    }
    else {
      obj[pair] = 1;
    }
  }

  let ans;
  let max = 0;

  Object.keys(obj).forEach(x => {
    if (obj[x] > max) {
      max = obj[x];
      ans = x;
    }
  });

  console.log(ans);

  c++;
});

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readLine() {
    return inputString[currentLine++];
}
function main(){
let n=readLine();
let twoGram=readLine();
let res=0;
let answer=" ";
for(let i=0;i<n-1;i++){
    let cur=0;
    for(let j=0;j<n-1;j++){
        if(twoGram[j]==twoGram[i] && twoGram[j+1] == twoGram[i+1])
        cur++;
        if(res<cur){
            res=cur;{
                answer=twoGram[i]+twoGram[i+1];
            }

        }

    }

}

     console.log(answer);
}

// https://codeforces.com/problemset/problem/977/B
// Big O:
// Time complexity: O(n)
// Space complexity: O(n)

const readline = require("readline");

// Read input
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let stringLength;
rl.on('line', (input) => {
    if (stringLength) {
        console.log(findMostCommonGram(input, stringLength));
        rl.close();
    } else {
        stringLength = input;
    }
});

// Problem
function findMostCommonGram(string, stringLength) {
    let mostCommonGram = "";
    let mostCommonGramOccurrences = 0;
    const gramOccurrences = {};

    for (let i = 0; i < stringLength - 1; i++) {
        const twogram = string[i] + string[i + 1];
        const occurrences = gramOccurrences[twogram] ? gramOccurrences[twogram] : 0;
        const currentOcurrences = occurrences + 1;
        if (currentOcurrences > mostCommonGramOccurrences) {
            mostCommonGram = twogram;
            mostCommonGramOccurrences = currentOcurrences;
        }

        gramOccurrences[twogram] = currentOcurrences;
    }

    return mostCommonGram;
}

// https://codeforces.com/problemset/problem/977/B
// Big O:
// Time complexity: O(n)
// Space complexity: O(n)

const readline = require("readline");

// Read input
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let stringLength;
rl.on('line', (input) => {
    if (stringLength) {
        console.log(findMostCommonGram(input, stringLength));
        rl.close();
    } else {
        stringLength = input;
    }
});

// Problem
function findMostCommonGram(string, stringLength) {
    let mostCommonGram = "";
    let mostCommonGramOccurrences = 0;
    const gramOccurrences = {};

    for (let i = 0; i < stringLength - 1; i++) {
        const twogram = string[i] + string[i + 1];
        const occurrences = gramOccurrences[twogram] ? gramOccurrences[twogram] + 1 : 1;
        if (occurrences > mostCommonGramOccurrences) {
            mostCommonGram = twogram;
            mostCommonGramOccurrences = occurrences;
        }

        gramOccurrences[twogram] = occurrences;
    }

    return mostCommonGram;
}

// https://codeforces.com/problemset/problem/977/B
// Big O:
// n: string length
// Time complexity: O(n)
// Space complexity:

const readline = require("readline");

// Read input
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let stringLength;
rl.on('line', (input) => {
    if (stringLength) {
        console.log(findMostCommonGram(input, stringLength));
        rl.close();
    } else {
        stringLength = input;
    }
});

// Problem
function findMostCommonGram(string, stringLength) {
    let mostCommonGram = "";
    const gramOccurrences = {};

    for (let i = 0; i < stringLength - 1; i++) {
        const twogram = string[i] + string[i + 1];
        const occurrences = gramOccurrences[twogram] ? gramOccurrences[twogram] + 1 : 1;
        const mostCommonOccurrences = gramOccurrences[mostCommonGram] ? gramOccurrences[mostCommonGram] : 0;
        if (occurrences > mostCommonOccurrences) {
            mostCommonGram = twogram;
        }

        gramOccurrences[twogram] = occurrences;
    }

    return mostCommonGram;
}

// https://codeforces.com/problemset/problem/977/B
// Big O:
// Time complexity:
// Space complexity:

const readline = require("readline");

// Read input
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let stringLength;
rl.on('line', (input) => {
    if (stringLength) {
        console.log(findMostCommonGram(input, stringLength));
        rl.close();
    } else {
        stringLength = input;
    }
});

// Problem
function findMostCommonGram(string, stringLength) {
    let mostCommonGram = "";
    let mostCommonGramOccurrences = 0;
    const gramOccurrences = {};

    for (let i = 0; i < stringLength - 1; i++) {
        const twogram = string[i] + string[i + 1];
        const occurrences = gramOccurrences[twogram] ? gramOccurrences[twogram] : 0;
        const currentOcurrences = occurrences + 1;
        if (currentOcurrences > mostCommonGramOccurrences) {
            mostCommonGram = twogram;
            mostCommonGramOccurrences = currentOcurrences;
        }

        gramOccurrences[twogram] = currentOcurrences;
    }

    return mostCommonGram;
}

// https://codeforces.com/problemset/problem/977/B
// Big O:
// n: string length
// Time complexity: O(n)
// Space complexity: O(n)

const readline = require("readline");

// Read input
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let stringLength;
rl.on('line', (input) => {
    if (stringLength) {
        console.log(findMostCommonGram(input, stringLength));
        rl.close();
    } else {
        stringLength = input;
    }
});

// Problem
function findMostCommonGram(string, stringLength) {
    let mostCommonGram = "";
    let mostCommonGramOccurrences = 0;
    const gramOccurrences = {};

    for (let i = 0; i < stringLength - 1; i++) {
        const twogram = string[i] + string[i + 1];
        const occurrences = gramOccurrences[twogram] ? gramOccurrences[twogram] + 1 : 1;
        if (occurrences > mostCommonGramOccurrences) {
            mostCommonGram = twogram;
            mostCommonGramOccurrences = occurrences;
        }

        gramOccurrences[twogram] = occurrences;
    }

    return mostCommonGram;
}

// https://codeforces.com/problemset/problem/977/B
// Big O:
// Time complexity:
// Space complexity:

const readline = require("readline");

// Read input
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let stringLength;
rl.on('line', (input) => {
    if (stringLength) {
        console.log(findMostCommonGram(input, stringLength));
        rl.close();
    } else {
        stringLength = input;
    }
});

// Problem
function findMostCommonGram(string, stringLength) {
    let mostCommonGram = "";
    let mostCommonGramOccurrences = 0;
    const gramOccurrences = {};

    for (let i = 0; i < stringLength - 1; i++) {
        const twogram = string[i] + string[i + 1];
        const occurrences = gramOccurrences[twogram] ? gramOccurrences[twogram] + 1 : 1;
        if (occurrences > mostCommonGramOccurrences) {
            mostCommonGram = twogram;
            mostCommonGramOccurrences = occurrences;
        }

        gramOccurrences[twogram] = occurrences;
    }

    return mostCommonGram;
}

// https://codeforces.com/problemset/problem/977/B
// Big O:
// n: string length
// Time complexity: O(n)
// Space complexity:

const readline = require("readline");

// Read input
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let stringLength;
rl.on('line', (input) => {
    if (stringLength) {
        console.log(findMostCommonGram(input, stringLength));
        rl.close();
    } else {
        stringLength = input;
    }
});

// Problem
function findMostCommonGram(string, stringLength) {
    let mostCommonGram = "";
    let mostCommonGramOccurrences = 0;
    const gramOccurrences = {};

    for (let i = 0; i < stringLength - 1; i++) {
        const twogram = string[i] + string[i + 1];
        const occurrences = gramOccurrences[twogram] ? gramOccurrences[twogram] + 1 : 1;
        if (occurrences > mostCommonGramOccurrences) {
            mostCommonGram = twogram;
            mostCommonGramOccurrences = occurrences;
        }

        gramOccurrences[twogram] = occurrences;
    }

    return mostCommonGram;
}

// https://codeforces.com/problemset/problem/977/B
// Big O:
// n: string length
// Time complexity: O(n)
// Space complexity:

const readline = require("readline");

// Read input
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let stringLength;
rl.on('line', (input) => {
    if (stringLength) {
        console.log(findMostCommonGram(input, stringLength));
        rl.close();
    } else {
        stringLength = input;
    }
});

// Problem
function findMostCommonGram(string, stringLength) {
    let mostCommonGram = "";
    let mostCommonGramOccurrences = 0;
    const gramOccurrences = {};

    for (let i = 0; i < stringLength - 1; i++) {
        const twogram = string[i] + string[i + 1];
        const occurrences = gramOccurrences[twogram] ? gramOccurrences[twogram] : 0;
        const currentOcurrences = occurrences + 1;
        if (currentOcurrences > mostCommonGramOccurrences) {
            mostCommonGram = twogram;
            mostCommonGramOccurrences = currentOcurrences;
        }

        gramOccurrences[twogram] = currentOcurrences;
    }

    return mostCommonGram;
}

// https://codeforces.com/problemset/problem/977/B
// Big O:
// Time complexity: O(n)
// n: string length
// Space complexity: O(n)

const readline = require("readline");

// Read input
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let stringLength;
rl.on('line', (input) => {
    if (stringLength) {
        console.log(findMostCommonGram(input, stringLength));
        rl.close();
    } else {
        stringLength = input;
    }
});

// Problem
function findMostCommonGram(string, stringLength) {
    let mostCommonGram = "";
    let mostCommonGramOccurrences = 0;
    const gramOccurrences = {};

    for (let i = 0; i < stringLength - 1; i++) {
        const twogram = string[i] + string[i + 1];
        const occurrences = gramOccurrences[twogram] ? gramOccurrences[twogram] : 0;
        const currentOcurrences = occurrences + 1;
        if (currentOcurrences > mostCommonGramOccurrences) {
            mostCommonGram = twogram;
            mostCommonGramOccurrences = currentOcurrences;
        }

        gramOccurrences[twogram] = currentOcurrences;
    }

    return mostCommonGram;
}

// https://codeforces.com/problemset/problem/977/B
// Big O:
// Time complexity: O(n)
// Space complexity:

const readline = require("readline");

// Read input
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let stringLength;
rl.on('line', (input) => {
    if (stringLength) {
        console.log(findMostCommonGram(input, stringLength));
        rl.close();
    } else {
        stringLength = input;
    }
});

// Problem
function findMostCommonGram(string, stringLength) {
    let mostCommonGram = "";
    let mostCommonGramOccurrences = 0;
    const gramOccurrences = {};

    for (let i = 0; i < stringLength - 1; i++) {
        const twogram = string[i] + string[i + 1];
        const occurrences = gramOccurrences[twogram] ? gramOccurrences[twogram] : 0;
        const currentOcurrences = occurrences + 1;
        if (currentOcurrences > mostCommonGramOccurrences) {
            mostCommonGram = twogram;
            mostCommonGramOccurrences = currentOcurrences;
        }

        gramOccurrences[twogram] = currentOcurrences;
    }

    return mostCommonGram;
}

const f = (n, s) => {
    const k = 2;

    const result = new Map();
    let best = null;
    let preBest = null;

    const compare = (sub) => {
        result[sub] = result[sub] ? result[sub] + 1 : 1;
        if (!best) {
            best = sub;
        } else if (result[sub] > result[best]) {
            preBest = best;
            best = sub;
        }
    };

    for (let i = 0; i < n - 1; i += 1) {
        if (result[best] > n / 2) {  return best; }
        if (preBest) {
            const leftSteps = n - 1 - i;
            const bestLeadSteps = result[best] - result[preBest];
            if (leftSteps < bestLeadSteps) { return best; }
        }

        compare(s.slice(i, i + k));
    }

    return best;
};

let i = '';
process.stdin.on('data', c => i += c);
process.stdin.on('end', () => {
    const {EOL} = require('os');
    const [ n, s ] = i.split(EOL);
    console.log(f(n, s));
});

var n = readline().split("").map(function(elem) {
	return parseInt(elem);
});
var inputs = readline();

// var n = 7, inputs = 'ABABCABA';

function divide(n, inputs){
	var arr = new Map();
 	for(var i = 0; i<inputs.length-1; i++){
 		var key = inputs[i]+''+inputs[i+1];
 		if(arr.has(key)){
 			var num = arr.get(key);
 			arr.set(key,num+1);
 		}else{
 			arr.set(key,1);
 		}
	}
	var max_value = 0;
	var max_key = '';
	arr.forEach(function(value,key,map){
		if(value > max_value){
			max_value = value;
			max_key = key;
		}
	});
	print(max_key);
	// console.log(max_key);
}
divide(n,inputs);

var n = readline();
var s = readline();
var d = {},tmp, max=0, v, out=s.substring(0,2);

for(var i=0;i<s.length-1;i++){
    tmp = s.substring(i,i+2);
    if(d[tmp]==undefined){
        d[tmp]=1;
    }
    else{
        d[tmp]++;
        if(d[tmp]>max){
            max=d[tmp];
            out=tmp;
        }
    }
}

print(out)

var n = readline();
var s = readline();
var d = {};
var tmp, max=0, v, out="";

for(var i=0;i<s.length-1;i++){
    tmp = s.substring(i,i+2);
    if(d[tmp]==undefined){
        d[tmp]=1;
        if(out==""){
            out=tmp;
        }
    }
    else{
        v = d[tmp];
        d[tmp] = v+1;
        if(v+1>max){
            max=v+1;
            out=tmp;
        }
    }
}

print(out)

var n = readline();
var s = readline();
//print(str)
var d = {};
var tmp;
var max=0;
var v;
var out="";
for(var i=0;i<s.length-1;i++){
    tmp = s.substring(i,i+2);
    //print(tmp);
    if(d[tmp]==undefined){
        d[tmp]=1;
        if(out==""){
            out=tmp;
        }
    }
    else{
        v = d[tmp];
        d[tmp] = v+1;
        if(v+1>max){
            max=v+1;
            out=tmp;
        }
    }
}
print(out)

var n = readline();
var s = readline();
var d = {},tmp, max=0, v, out=s.substring(0,2);

for(var i=0;i<s.length-1;i++){
    tmp = s.substring(i,i+2);
    if(d[tmp]==undefined){
        d[tmp]=1;
    }
    else{
        v = d[tmp];
        d[tmp] = v+1;
        if(v+1>max){
            max=v+1;
            out=tmp;
        }
    }
}

print(out)

function calculateProb(str1, str2) {
    var num = parseInt(str1);
    var max = 0;
    var ans = '';
    var ob = {};

    for (var i = 0; i < str2.length - 1; i++) {
        var str = str2[i] + str2[i + 1];

        if (!ob[str]) {
            ob[str] = 0;
        }

        ob[str]++;
    }

    for (var j in ob) {
        if (ob.hasOwnProperty(j)) {
            if (max < ob[j]) {
                max = ob[j];
                ans = j;
            }
        }
    }

    return ans;
}

var s1 = readline();
var s2 = readline();

print(calculateProb(s1, s2));

var uselessLine = readline();
var input = readline();

var splitted = input.split('');
var maximal = 0;
var twogram = '';

for(var  j= 0; j< splitted.length; j++) {
    if(j+1 < splitted.length) {
        var current = splitted[j] + splitted[j+1];
        var numOcurr = input.match(new RegExp(current, 'g')).length;
    if(numOcurr > maximal)
        maximal = numOcurr;
        twogram = current;
    }
}

print(twogram);

var n = readline().split("").map(function(elem) {
	return parseInt(elem);
});
var inputs = readline();

// var n = 7, inputs = 'ABABCABA';

function divide(n, inputs){
	var arr = new Map();
 	for(var i = 0; i<inputs.length-1; i++){
 		var key = inputs[i]+''+inputs[i+1];
 		if(arr.has(key)){
 			var num = arr.get(key);
 			arr.set(key,num+1);
 		}else{
 			arr.set(key,1);
 		}
	}
	var max_value = 0;
	arr.forEach(function(value,key,map){
		if(value > max_value){
			max_value = value;
		}
	});
	print(max_value);
	// console.log(max_value);
}
divide(n,inputs);

var n = readline();
var s = readline();
var d = {},tmp, max=0, v, out=s.substring(0,2);

for(var i=0;i<s.length-1;i++){
    tmp = s.substring(i,i+2);
    if(d[tmp]==undefined){
        d[tmp]=1;
    }
    else{
        d[tmp]++;
        if(d[tmp]>max){
            max=v+1;
            out=tmp;
        }
    }
}

print(out)

// http://codeforces.com/contest/977/problem/B

var arg1 = readline();
var arg2 = readline();

print(arg1);
print(arg2);

//let length = parseInt(arg1);
//let string = arg2;

//function main(length, string) {
    //let hash = {};

    //for (let i = 0; i < length - 1; i++) {
        //let substring = `${string[i]}${string[i + 1]}`;
        //if (hash[substring]) {
            //hash[substring] = hash[substring] + 1;
        //} else {
            //hash[substring] = 1;
        //}
    //}

    //let twogrammaList = Object.keys(hash);
    //let biggest = twogrammaList[0];

    //for (let i = 1; i < twogrammaList.length; i++) {
        //let tg = twogrammaList[i];

        //if (hash[tg] > hash[biggest]) {
            //biggest = twogrammaList[i];
        //}
    //}

    //return biggest;
//}

//print(main(length, string));

let n, s;

process.stdin.on('data', function(data) {
  if (!n) {
    n = parseInt(data.toString());
  } else {
    s = data.toString().trim();
    console.log(getTwoGrams(n, s));
    s = undefined;
    n = undefined;
  }
});

function getTwoGrams(n, s) {
  let max = 0;
  let pair;
  let i = 0;
  let sub = s.substring(i, i+2);

  while (sub.length === 2) {
    const regex = sub[0] == sub[1] ? `${sub}+` : `${sub}`;
    const matches = s.match(new RegExp(regex, 'g'));

    const occurances = matches.reduce((carry, match, index) => {
      carry = carry + (matches[index].length - 1);
      return carry;
    }, 0);

    if (max <= occurances) {
      max = occurances;
      pair = sub;
    }
    i++;
    sub = s.substring(i, i+2);
  }

  return pair;
}

let i = '';

process.stdin.on('data', c => i += c);
process.stdin.on('end', function(data) {
    const {EOL} = require('os')
    const [length, input] = i.split(EOL);
    const n = parseInt(length);
    const s = input.trim();
    console.log(getTwoGrams(n, s));
})

function getTwoGrams(n, s) {
  let max = 0;
  let pair;
  let i = 0;
  let sub = s.substring(i, i+2);

  const regex = sub[0] == sub[1] ? `${sub}+` : `${sub}`;
  const matches = s.match(new RegExp(regex, 'g'));
  const reducer = (carry, match, index) => {
    carry = carry + (matches[index].length - 1);
    return carry;
  };

  while (sub.length === 2) {
    const occurances = matches.reduce(reducer, 0);

    if (max <= occurances) {
      max = occurances;
      pair = sub;
    }
    i++;
    sub = s.substring(i, i+2);
  }

  return pair;
}


var readp = () => {
  var temp = readline().split(' ');
  return [parseFloat(temp[0]), parseFloat(temp[1])];
};
var p = [readp(), readp(), readp()];
var memo = [];
var cp = (c) => (i, j) => {
  if (p[i][c] === p[j][c]) {
    memo.push({i:i, j:j, c:c});
    return 1;
  } else {
    return 0;
  }
}
var cnt = (c) => cp(c)(0, 1) + cp(c)(0, 2) + cp(c)(1, 2);
var between = () => {
  var o = memo[0];
  var k = 3-o.i-o.j;
  var c = 1-o.c;
  return p[o.i][c]<p[k][c] && p[k][c]<p[o.j][c] ||
    p[o.i][c]>p[k][c] && p[k][c]>p[o.j][c];
};
if (cnt(0)===3 || cnt(1)===3) {
  print(1);
} else if (cnt(0)===1 && cnt(1)===1) {
  print(2);
} else if ((cnt(0)===1 || cnt(1)===1) && !between()){
  print(2);
} else {
  print(3);
}

var points = new Array(3);
for (var i = 0; i < points.length; ++i) {
    points[i] = readline().split(" ", 2);
    for (var j = 0; j < 2; ++j) {
        points[i][j] = Number(points[i][j]);
    }
}

function same(x, y, z) {
    return x === y && y === z;
}
function right(a, b, c) {
    return b[0] === c[0] && (a[1] >= Math.max(b[1], c[1]) || a[1] <= Math.min(b[1], c[1])) ||
        b[1] === c[1] && (a[0] >= Math.max(b[0], c[0]) || a[0] <= Math.min(b[0], c[0]));
}

if (same(points[0][0], points[1][0], points[2][0]) ||
    same(points[0][1], points[1][1], points[2][1])) {
        print(1);
} else if (right(points[0], points[1], points[2]) ||
    right(points[1], points[0], points[2]) ||
    right(points[2], points[0], points[1])) {
    print(2);
} else {
    print(3);
}

var points = new Array(3);
for (var i = 0; i < points.length; ++i) {
    points[i] = readline().split(" ", 2);
}

function same(x, y, z) {
    return x === y && y === z;
}
function right(a, b, c) {
    return b[0] === c[0] && (a[1] >= Math.max(b[1], c[1]) || a[1] <= Math.min(b[1], c[1])) ||
        b[1] === c[1] && (a[0] >= Math.max(b[0], c[0]) || a[0] <= Math.min(b[0], c[0]));
}

if (same(points[0][0], points[1][0], points[2][0]) ||
    same(points[0][1], points[1][1], points[2][1])) {
        print(1);
} else if (right(points[0], points[1], points[2]) ||
    right(points[1], points[0], points[2]) ||
    right(points[2], points[0], points[1])) {
    print(2);
} else {
    print(3);
}

var readp = () => {
  var temp = readline().split(' ');
  return [parseFloat(temp[0]), parseFloat(temp[1])];
};
var p = [readp(), readp(), readp()];
var dis2 = (i, j) =>
  Math.pow(p[i][0]-p[j][0], 2) + Math.pow(p[i][1]-p[j][1], 2);
var cos = (i) => {
  var j = i-1 < 0 ? i+2 : i-1;
  var dj = dis2(i, j);
  var k = i+1 > 2 ? i-2 : i+1;
  var dk = dis2(i, k);
  var di = dis2(j, k);
  var cos = (dj+dk-di) / (2*Math.sqrt(dj*dk));
  return Math.round(1E6*cos) / 1E6;
};
(() => {
  for (var i = 0; i < 3; ++i) {
    switch (cos(i)) {
      case -1:
      case 1:
        print(1);
        return ;
      case 0:
        print(2);
        return ;
    }
  }
  print(3);
})();

var points = new Array(3);
for (var i = 0; i < points.length; ++i) {
    points[i] = readline().split(" ", 2);
}

function same(x, y, z) {
    return x === y && y === z;
}
function right(a, b, c) {
    return a[0] === b[0] && a[1] === c[1] ||
        a[1] === b[1] && a[0] === c[0];
}

if (same(points[0][0], points[1][0], points[2][0]) ||
    same(points[0][1], points[1][1], points[2][1])) {
        print(1);
} else if (right(points[0], points[1], points[2]) ||
    right(points[1], points[0], points[2]) ||
    right(points[2], points[0], points[1])) {
    print(2);
} else {
    print(3);
}

var points = new Array(3);
for (var i = 0; i < points.length; ++i) {
    points[i] = readline().split(" ", 2);
    for (var j = 0; j < 2; ++j) {
        points[i][j] = Number(points[i][j]);
    }
}

function same(x, y, z) {
    return x === y && y === z;
}
function right(a, b, c) {
    return b[0] === c[0] && (a[1] > Math.max(b[1], c[1]) || a[1] < Math.min(b[1], c[1])) ||
        b[1] === c[1] && (a[0] > Math.max(b[0], c[0]) || a[0] < Math.min(b[0], c[0]));
}

if (same(points[0][0], points[1][0], points[2][0]) ||
    same(points[0][1], points[1][1], points[2][1])) {
        print(1);
} else if (right(points[0], points[1], points[2]) ||
    right(points[1], points[0], points[2]) ||
    right(points[2], points[0], points[1])) {
    print(2);
} else {
    print(3);
}

var points = new Array(3);
for (var i = 0; i < points.length; ++i) {
    points[i] = readline().split(" ", 2);
}

function same(x, y, z) {
    return x === y && y === z;
}
function right(a, b, c) {
    return b[0] === c[0] && (a[1] > Math.max(b[1], c[1]) || a[1] < Math.min(b[1], c[1])) ||
        b[1] === c[1] && (a[0] > Math.max(b[0], c[0]) || a[0] < Math.min(b[0], c[0]));
}

if (same(points[0][0], points[1][0], points[2][0]) ||
    same(points[0][1], points[1][1], points[2][1])) {
        print(1);
} else if (right(points[0], points[1], points[2]) ||
    right(points[1], points[0], points[2]) ||
    right(points[2], points[0], points[1])) {
    print(2);
} else {
    print(3);
}


tmp1 = Array(0,0,0,0,0,0);
tmp2 = Array(0,0,0,0,0,0);
n = Number(readline());
ar1 = readline().split(' ').map(Number);
ar2 = readline().split(' ').map(Number);
ans = 0;
for(var i = 0;i<n;i++) {
	tmp1[ar1[i]]++;
	tmp2[ar2[i]]++;
}
for(var i = 1;i<=5;i++) {
	if((tmp1[i]-tmp2[i])%2 != 0) {
		ans=-1;
		break;
	}
	ans+=((x)=>{if(x < 0) {
		return -x;
	}
	else {
		return x;
	}})(tmp1[i]-tmp2[i])/4;
}
print(ans);

var n = parseInt(readline());
var ga = readline().split(' ').map(function(x) {
  return parseInt(x);
});
var gb = readline().split(' ').map(function(x) {
  return parseInt(x);
});
tot = [];
tota = [];
totb = [];
for(var i = 1; i <= 5; i += 1) {
  tot[i] = 0;
  tota[i] = 0;
  totb[i] = 0;
}
ga.forEach(function(x) {
  tot[x] += 1;
  tota[x] += 1;
});
gb.forEach(function(x) {
  tot[x] += 1;
  totb[x] += 1;
});
var s = true;
var r = 0;
for(var i = 1; i <= 5; i += 1) {
  if(tot[i] % 2 !== 0) {
    s = false;
  }
  r += Math.abs(tot[i] / 2 - tota[i]);
}
if(s) {
  print(r / 2);
} else {
  print(-1);
}

function ansa(s,a,b){

    var cnt = [0,0,0,0,0,0]
    var all = 0;
    for(var i = 0 ; i < s ; i++){
      cnt[a[i]] += 1;
    //  console.log(a[i],cnt[a[i]])
    }
    for(var i = 0 ; i < s ; i++){
      cnt[b[i]] -= 1;
  //    console.log(b[i],cnt[a[i]])
    }
    for(var i = 1 ; i <= 5 ; i++){
      if(Math.abs(cnt[i]) % 2 !== 0){
        print("-1");
        return;
      }
    }
    for(var i = 1 ; i <= 5 ; i++){
//console.log(cnt[i])
      all += Math.abs(cnt[i]);
    }
    print(all/4);
}

//ansa(6,[1,1,1,1,1,1],[5,5,5,5,5,5])

var line = readline();

var a = readline().split(" ");
for(var i = 0 ; i < a.length ; i++) a[i] = parseInt(a[i]);
var b = readline().split(' ');
for(var i = 0 ; i < b.length ; i++) b[i] = parseInt(b[i]);

ansa(parseInt(line),a,b);

var n = readline();
var group_a = readline().split(' ');
var group_b = readline().split(' ');

function solve(a, b) {
    var rlt = {};

    a.forEach(str => {rlt[str] = (rlt[str] || 0) +1;})
    b.forEach(str => {rlt[str] = (rlt[str] || 0) -1;})
    // print(JSON.stringify(rlt))
    var r = 0;
    for (var key in rlt) {
        if (rlt[key]%2)
            return -1
        r += Math.abs(rlt[key])/2
    }
    return r/2
}

print(solve(group_a, group_b))

var сount = readline();

var class1 = readline().split(' ').sort().reverse();
var class2 = readline().split(' ').sort().reverse();

var deIntersection = deIntersect(class1, class2);
class1 = deIntersection.a;
class2 = deIntersection.b;

var fail = false;
var replaceCount = 0;

var index = 0;

while (index < class1.length) {
    if (class1[index] !== class2[index]) {
        if (class2[index] > class1[index]) {
            if (class2.lastIndexOf(class2[index]) !== index
            	&& class1.lastIndexOf(class1[index]) !== index) {
				var class2Index = class2.lastIndexOf(class2[index]);
				class2.splice(class2Index,1);
				class1.splice(0,1);
				replaceCount++;
	        } else {
	        	fail = true;
	        }
        }
        if (class2[index] < class1[index]) {
            if (class1.lastIndexOf(class1[index]) !== index
            	&& class2.lastIndexOf(class2[index]) !== index) {
				var class1Index = class1.lastIndexOf(class1[index])
				class1.splice(class1Index,1);
				class2.splice(index, 1);
				replaceCount++;
	        } else {
	        	fail = true;
	        }
        }
    }
    index++;
}

if (!fail) {
	print(replaceCount);
} else {
	print(-1);
}

function deIntersect (a,b) {
	a.forEach ((item, index) => {
		var indexInB = b.indexOf(item);
		if (indexInB !== -1) {
			b[indexInB] = 'empty';
			a[index] = 'empty';
		}
	});

	var newA = a.filter((item) => {
		return item !== 'empty';
	});

	var newB = b.filter((item) => {
		return item !== 'empty';
	});

	return {'a': newA, 'b': newB}
}

var n = readline();
var group_a = readline().split(' ');
var group_b = readline().split(' ');

function solve(a, b) {
    var rlt = {};

    a.forEach(str => {rlt[str] ++;})
    b.forEach(str => {rlt[str] --;})

    var r = 0;
    for (var key in rlt) {
        if (rlt[key]%2)
            return -1
        r += Math.abs(rlt[key])/2
    }
    return r
}

print(solve(group_a, group_b))

var n = readline();
var group_a = readline().split(' ');
var group_b = readline().split(' ');

function solve(a, b) {
    var rlt = {};

    a.forEach(str => {rlt[str] = (rlt[str] || 0) +1;})
    b.forEach(str => {rlt[str] = (rlt[str] || 0) -1;})
    print(JSON.stringify(rlt))
    var r = 0;
    for (var key in rlt) {
        if (rlt[key]%2)
            return -1
        r += Math.abs(rlt[key])/2
    }
    return r/2
}

print(solve(group_a, group_b))

function ansa(s,a,b){

    var cnt = []
    var all = 0;
    for(var i = 0 ; i < s ; i++)cnt[i] = 0;
    for(var i = 0 ; i < s ; i++)cnt[a[i] - 1] += 1;
    for(var i = 0 ; i < s ; i++)cnt[b[i] - 1] -= 1;
    for(var i = 0 ; i < s ; i++){
      if(Math.abs(cnt[i]) % 2 !== 0){
        print("-1");
        return;
      }
    }
    for(var i = 0 ; i < s ; i++){
      all += Math.abs(cnt[i]);
    }
    print(all/4);
}

var line = readline();

var a = readline().split(" ");
for(var i = 0 ; i < a.length ; i++) a[i] = parseInt(a[i]);
var b = readline().split(' ');
for(var i = 0 ; i < b.length ; i++) b[i] = parseInt(b[i]);

ansa(parseInt(line),a,b);

function ansa(s,a,b){

    var cnt = []
    var all = 0;
    for(var i = 0 ; i < s ; i++)cnt[i] = 0;
    for(var i = 0 ; i < s ; i++)cnt[a[i] - 1] += 1;
    for(var i = 0 ; i < s ; i++)cnt[b[i] - 1] -= 1;
    for(var i = 0 ; i < s ; i++){
      if(Math.abs(cnt[i]) % 2 !== 0){
        print("-1");
        return;
      }
    }
    for(var i = 0 ; i < s ; i++){
      all += Math.abs(cnt[i]);
    }
    print(all/2);
}

var line = readline();

var a = readline().split(" ");
for(var i = 0 ; i < a.length ; i++) a[i] = parseInt(a[i]);
var b = readline().split(' ');
for(var i = 0 ; i < b.length ; i++) b[i] = parseInt(b[i]);

ansa(parseInt(line),a,b);

function ansa(s,a,b){

    var cnt = [0,0,0,0,0,0]
    var all = 0;
    for(var i = 0 ; i < s ; i++){
      cnt[a[i]] += 1;
    //  console.log(a[i],cnt[a[i]])
    }
    for(var i = 0 ; i < s ; i++){
      cnt[b[i]] -= 1;
  //    console.log(b[i],cnt[a[i]])
    }
    for(var i = 0 ; i < s ; i++){
      if(Math.abs(cnt[i]) % 2 !== 0){
        print("-1");
        return;
      }
    }
    for(var i = 1 ; i <= 5 ; i++){
//console.log(cnt[i])
      all += Math.abs(cnt[i]);
    }
    print(all/4);
}

//ansa(6,[1,1,1,1,1,1],[5,5,5,5,5,5])

var line = readline();

var a = readline().split(" ");
for(var i = 0 ; i < a.length ; i++) a[i] = parseInt(a[i]);
var b = readline().split(' ');
for(var i = 0 ; i < b.length ; i++) b[i] = parseInt(b[i]);

ansa(parseInt(line),a,b);

var сount = readline();

var class1 = readline().split(' ').sort().reverse();
var class2 = readline().split(' ').sort().reverse();

var deIntersection = deIntersect(class1, class2);
class1 = deIntersection.a;
class2 = deIntersection.b;

var fail = false;
var replaceCount = 0;

class1.forEach((item, index) => {
    if (class1[index] !== class2[index]) {
        if (class2[index] > class1[index]) {
            if (class2.lastIndexOf(class2[index]) !== index) {
				var class2Index = class2.lastIndexOf(class2[index])
				var temp = class2[class2Index];
				class2[class2Index] = class1[index];
				class1[index] = temp;
				replaceCount++;
	        } else {
	        	fail = true;
	        }
        }
        if (class2[index] < class1[index]) {
            if (class1.lastIndexOf(class1[index]) !== index) {
				var class1Index = class1.lastIndexOf(class1[index])
				var temp = class1[class1Index];
				class1[class1Index] = class2[index];
				class2[index] = temp;
				replaceCount++;
	        } else {
	        	fail = true;
	        }
        }
    }
});

if (!fail) {
	print(replaceCount);
} else {
	print(-1);
}

function deIntersect (a,b) {
	a.forEach ((item, index) => {
		var indexInB = b.indexOf(item);
		if (indexInB !== -1) {
			b[indexInB] = 'empty';
			a[index] = 'empty';
		}
	});

	var newA = a.filter((item) => {
		return item !== 'empty';
	});

	var newB = b.filter((item) => {
		return item !== 'empty';
	});

	return {'a': newA, 'b': newB}
}

var сount = readline();

var class1 = readline().split(' ').sort().reverse();
var class2 = readline().split(' ').sort().reverse();

var deIntersection = deIntersect(class1, class2);
class1 = deIntersection.a;
class2 = deIntersection.b;

print (class1);
print (class2);

var fail = false;
var replaceCount = 0;

var index = 0;

while (index < class1.length) {
    if (class1[index] !== class2[index]) {
        if (class2[index] > class1[index]) {
            if (class2.lastIndexOf(class2[index]) !== index) {
				var class2Index = class2.lastIndexOf(class2[index])
				class2.splice(class2Index,1);
				class1.splice(0,1);
				replaceCount++;
	        } else {
	        	fail = true;
	        }
        }
        if (class2[index] < class1[index]) {
            if (class1.lastIndexOf(class1[index]) !== index) {
				var class1Index = class1.lastIndexOf(class1[index])
				class1.splice(class1Index,1);
				class2.splice(index, 1);
				replaceCount++;
	        } else {
	        	fail = true;
	        }
        }
    }
    index++;
}

if (!fail) {
	print(replaceCount);
} else {
	print(-1);
}

function deIntersect (a,b) {
	a.forEach ((item, index) => {
		var indexInB = b.indexOf(item);
		if (indexInB !== -1) {
			b[indexInB] = 'empty';
			a[index] = 'empty';
		}
	});

	var newA = a.filter((item) => {
		return item !== 'empty';
	});

	var newB = b.filter((item) => {
		return item !== 'empty';
	});

	return {'a': newA, 'b': newB}
}

var сount = readline();

var class1 = readline().split(' ').sort().reverse();
var class2 = readline().split(' ').sort().reverse();

var deIntersection = deIntersect(class1, class2);
class1 = deIntersection.a;
class2 = deIntersection.b;

print(class1);
print(class2);

var fail = false;
var replaceCount = 0;

class1.forEach((item, index) => {
    if (class1[index] !== class2[index]) {
        if (class2[index] > class1[index]) {
            if (class2.lastIndexOf(class2[index]) !== index) {
				var class2Index = class2.lastIndexOf(class2[index])
				var temp = class2[class2Index];
				class2[class2Index] = class1[index];
				class1[index] = temp;
				replaceCount++;
	        } else {
	        	fail = true;
	        }
        }
        if (class2[index] < class1[index]) {
            if (class1.lastIndexOf(class1[index]) !== index) {
				var class1Index = class1.lastIndexOf(class1[index])
				var temp = class1[class1Index];
				class1[class1Index] = class2[index];
				class2[index] = temp;
				replaceCount++;
	        } else {
	        	fail = true;
	        }
        }
    }
});

if (!fail) {
	print(replaceCount);
} else {
	print(-1);
}

function deIntersect (a,b) {
	a.forEach ((item, index) => {
		var indexInB = b.indexOf(item);
		if (indexInB !== -1) {
			b[indexInB] = 'empty';
			a[index] = 'empty';
		}
	});

	var newA = a.filter((item) => {
		return item !== 'empty';
	});

	var newB = b.filter((item) => {
		return item !== 'empty';
	});

	return {'a': newA, 'b': newB}
}

var сount = readline();

var class1 = readline().split(' ').sort().reverse();
var class2 = readline().split(' ').sort().reverse();

var deIntersection = deIntersect(class1, class2);
class1 = deIntersection.a;
class2 = deIntersection.b;

var fail = false;
var replaceCount = 0;

var index = 0;

while (index < class1.length) {
    if (class1[index] !== class2[index]) {
        if (class2[index] > class1[index]) {
            if (class2.lastIndexOf(class2[index]) !== index) {
				var class2Index = class2.lastIndexOf(class2[index])
				class2.splice(class2Index,1);
				class1.splice(0,1);
				replaceCount++;
	        } else {
	        	fail = true;
	        }
        }
        if (class2[index] < class1[index]) {
            if (class1.lastIndexOf(class1[index]) !== index) {
				var class1Index = class1.lastIndexOf(class1[index])
				class1.splice(class1Index,1);
				class2.splice(index, 1);
				replaceCount++;
	        } else {
	        	fail = true;
	        }
        }
    }
    index++;
}

if (!fail) {
	print(replaceCount);
} else {
	print(-1);
}

function deIntersect (a,b) {
	a.forEach ((item, index) => {
		var indexInB = b.indexOf(item);
		if (indexInB !== -1) {
			b[indexInB] = 'empty';
			a[index] = 'empty';
		}
	});

	var newA = a.filter((item) => {
		return item !== 'empty';
	});

	var newB = b.filter((item) => {
		return item !== 'empty';
	});

	return {'a': newA, 'b': newB}
}


var len = parseInt(readline());
	var str = readline();
	var ans = 0, sum = 0;
	var s='', s1=[];
	var a=[];
	if(str.indexOf('B') < 0){
		print(0);
	}
	else if(str.indexOf('W') < 0){
		ans = len;
		print(1);
		print(ans);
	}
	else{
		var r = "W";
		s = str.replace(new RegExp(r, 'gm'),' ');
		var r1 = /\s+/g;
		s = s.replace(r1,' ');
		s1 = s.split(" ");
		var k = 0;
		for(var i = 0; i < s1.length; i++){
			if(s1[i] !== ""){
				a[k++] = s1[i].length;
			}
		}
		print(k);
		for(var j = 0; j < k; j++){
			print(a[j]+' ');
		}
	}

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let c = 0;

rl.on('line', (str) => {
  if (c === 0) {
    c++;
    return;
  }

  let ans = 0;
  const arr = [];
  let inc = 0;

  for (let i = 0; i < str.length - 1; i++) {
    if (str[i] === 'B') {
      inc++;

      if (str[i + 1] === 'W') {
        ans++;
        arr.push(inc);
      }
    }
    else {
      inc = 0;
    }
  }

  if (str[str.length - 1] === 'B') {
    ans++;
    inc++;
    arr.push(inc);
  }

  console.log(ans);
  console.log(arr.join(' '));

  c++;
});

var a = parseInt(readline()),
	b = readline(),
    array = [],
    count = 0

	for (var i = 0; i < b.length; i++) {
		if (b[i] == 'B') {
			count++
		}
		if (b[i] == 'W') {
			if (count != 0)
				array.push(count)
			count = 0
		}
	}
	if (count != 0) {
		array.push(count)
	}
	print(array.length)
	if (array.length != 0) {
		print(array.join(' '))
	}

var a = readline().split(' ').map(Number);
var b = readline().toString() + "W";
var c = 0, d = 0,res = "";

for(var i = 0;i <= a;++i)
    if(b[i] === 'B')
        ++c;
    else if (c !== 0)
        res = res + c.toString() + " ",c = 0,++d;

print(d)
print(res);

var n = parseInt(readline()),
    tab = readline(),
	state = 'W',
	curlen = 0,
	res = []

for (var i = 0 ; i < tab.length ; i++) {
  if (tab[i] == 'B') curlen++
  else if (state == 'B') {
	res.push(curlen)
	curlen = 0
  }
  state = tab[i]
}
if (state == 'B') res.push(curlen)

print(res.length)
print(res.join(' '))

var n = parseInt(readline());
var row = readline();

var counters = [];
counters[0] = 0;

var current_counter = 0;
var k = 0;

for(var i = 0; i < n; i++) {

    if(i > 0 && row[i - 1] === 'W' && row[i] === 'B' && counters[current_counter] > 0) {
        current_counter++;
        counters[current_counter] = 0;
    }

    if(row[i] === 'B')
        counters[current_counter]++;
}

if(!(counters.length === 1 && counters[0] === 0))
    k = counters.length;

// print result
print(k);
if(k > 0)
    print(counters.join(' '));

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error('\n↑入力 ↓出力');
  Main();
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var N = nextInt();
  var s = next().split("W");
  var output = [];
  for(var i = 0; i < s.length; i++){
    if(s[i] != ""){
      output.push(s[i].length);
    }
  }
  myout(output.length);
  myout(myconv(output, 8));
}

const readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});
let c = 0;

rl.on('line', (str) => {
  if (c === 0) {
    c++;
    return;
  }

  const ans = str.match(/[B]+/g) || [];
  console.log(ans.length);
  console.log(ans.map(x => x.length).join(' '));

  // let ans = 0;
  // const arr = [];
  // let inc = 0;

  // for (let i = 0; i < str.length - 1; i++) {
  //   if (str[i] === 'B') {
  //     inc++;

  //     if (str[i + 1] === 'W') {
  //       ans++;
  //       arr.push(inc);
  //     }
  //   }
  //   else {
  //     inc = 0;
  //   }
  // }

  // if (str[str.length - 1] === 'B') {
  //   ans++;
  //   inc++;
  //   arr.push(inc);
  // }

  // console.log(ans);
  // console.log(arr.join(' '));

  c++;
});

var a = readline().split(' ').map(Number);
var b = readline().toString() + "W";
var c = 0, d = 0,res = "";

for(var i = 0;i <= a;++i)
    if(b[i] === 'B')
        ++c;
    else if (c !== 0)
        res = res + c.toString() + " ",c = 0;

print(res);

var len = parseInt(readline());
	var str = readline();
	var ans = 0, sum = 0;
	var s='', s1=[];
	var a=[];
	if(str.indexOf('B') === -1){
		sum = 0;
		//return sum;
		print(sum);
	}
	else if(str.indexOf('W') === -1){
		sum = 1;
		ans = len;
		print(ans);
	}
	else{
		/*for(var i = 0; i < len; i++){
			if(str[i] === 'W'){
				s = str.replace('W',' ');
			}
		}
		}*/
		var r = "W";
		s = str.replace(new RegExp(r, 'gm'),' ');
		var r1 = /\s+/g;
		s = s.replace(r1,' ');
		s1 = s.split(" ");
		var k = 0;
		for(var i = 0; i < s1.length; i++){
			if(s1[i] !== ""){
				a[k++] = s1[i].length;
			}
		}
	}
	//return k +' ' +a;
	print(k);
	for(var j = 0; j < k; j++){
		print(a[j]+' ');
	}

var len = parseInt(readline());
	var str = readline();
	var ans = 0, sum = 0;
	var s='', s1=[];
	var a=[];
	if(str.indexOf('B') === -1){
		print(0);
	}
	else if(str.indexOf('W') === -1){
		ans = len;
		print(ans);
	}
	else{
		/*for(var i = 0; i < len; i++){
			if(str[i] === 'W'){
				s = str.replace('W',' ');
			}
		}
		}*/
		var r = "W";
		s = str.replace(new RegExp(r, 'gm'),' ');
		var r1 = /\s+/g;
		s = s.replace(r1,' ');
		s1 = s.split(" ");
		var k = 0;
		for(var i = 0; i < s1.length; i++){
			if(s1[i] !== ""){
				a[k++] = s1[i].length;
			}
		}
	}
	//return k +' ' +a;

	print(k);
	for(var j = 0; j < k; j++){
		print(a[j]+' ');
	}

var len = parseInt(readline());
	var str = readline();
	var ans = 0, sum = 0;
	var s='', s1=[];
	var a=[];
	if(str.indexOf('B') < 0){
		print(0);
	}
	else if(str.indexOf('W') < 0){
		ans = len;
		print(ans);
	}
	else{
		var r = "W";
		s = str.replace(new RegExp(r, 'gm'),' ');
		var r1 = /\s+/g;
		s = s.replace(r1,' ');
		s1 = s.split(" ");
		var k = 0;
		for(var i = 0; i < s1.length; i++){
			if(s1[i] !== ""){
				a[k++] = s1[i].length;
			}
		}
			print(k);
    	for(var j = 0; j < k; j++){
    		print(a[j]+' ');
    	}
	}


let store = [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}];

function checkDigit(n, dig) {
  if (dig == 0) {
    return { count: int(n == 0 ? 0 : 1), decrement: 0 };
  }
  if (dig > n) {
    return {
      count: int(1),
      decrement: dig - n
    };
  }
  return {
    count: int(2),
    decrement: dig
  };
}

function getNumString(arr) {
  const joined = arr.join("");
  const trimmed = joined.replace(/0/g, " ").trimLeft();
  return trimmed.replace(/\s/g, "0") || "0";
}

function solveCore(n, dig = 0) {
  if (store[dig][n]) {
    return store[dig][n];
  }
  if (n.length === 1) {
    return (store[dig][n] = checkDigit(n, dig));
  }

  let first = n[0];
  let tailArr = n.substring(1).split("");
  let total = int();

  while (first >= 0) {
    const r = solveCore(getNumString(tailArr), Math.max(first, dig));
    total = plus(total, r.count);
    first -= 1;
    tailArr = tailArr.map(() => "9");
    tailArr.pop();
    tailArr.push(`${(10 - r.decrement) % 10}`);
  }

  return (store[dig][n] = { count: total, decrement: 10 - tailArr.pop() });
}

function solve(n) {
  store = [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}];
  const r = solveCore(n, 0);
  return bintToString(r.count);
}

function* main() {
  const n = yield;
  const r = solve(n);
  console.log(r);
  process.exit(0);
}

if (!module.parent) {
  (() => {
    const q = main();
    q.next();
    require("readline")
      .createInterface({
        input: process.stdin,
        output: null
      })
      .on("line", line => q.next(line));
  })();
}

function int(n = 0) {
  return [
    n,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ];
}
function plus(int1, int2) {
  let z = 0;
  return int1.map((_, i) => {
    z = z + int1[i] + int2[i];
    const r = z % 10;
    z = Math.floor(z / 10);
    return r;
  });
}

function bintToString(i) {
  return getNumString(Array.from(i).reverse());
}

exports.solve = solve;

let store = [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}];

function checkDigit(n, dig) {
  if (dig === 0 && n === 0) {
    return { count: 0, decrement: 0 };
  }
  return {
    count: 1,
    decrement: Math.max(n, dig) - n
  };
}

function splitNumber(n) {
  const digitsPow = 10 ** Math.floor(Math.log10(n));
  let first = Math.floor(n / digitsPow);
  let tail = n % digitsPow;
  return [first, tail];
}

function solveCore(n, dig = 0) {
  if (store[dig][n]) {
    return store[dig][n];
  }
  if (n < 10) {
    return (store[dig][n] = checkDigit(n, dig));
  }

  let rest = n;
  let [first, tail] = splitNumber(rest);
  let count = 0;

  while (rest > 0) {
    const r = solveCore(tail, Math.max(first, dig));
    count += r.count;
    rest -= tail + r.decrement;
    [first, tail] = splitNumber(rest);
  }

  return (store[dig][n] = { count, decrement: -rest });
}
function solve(n) {
  store = [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}];
  const r = solveCore(n, 0);
  return r.count;
}

function* main() {
  const n = parseInt(yield);
  const r = solve(n);
  console.log(r);
  process.exit(0);
}

if (!module.parent) {
  (() => {
    const q = main();
    q.next();
    require("readline")
      .createInterface({
        input: process.stdin,
        output: null
      })
      .on("line", line => q.next(line));
  })();
}

exports.solve = solve;

function solve(n) {
  let rest = n;
  let count = 0;
  while (rest > 0) {
    rest -= Math.max(...rest.toString().split(""));
    count += 1;
  }
  return count;
}

function* main() {
  const n = parseInt(yield);
  const r = solve(n);
  console.log(r);
  process.exit(0);
}

if (!module.parent) {
  (() => {
    const q = main();
    q.next();
    require("readline")
      .createInterface({
        input: process.stdin,
        output: null
      })
      .on("line", line => q.next(line));
  })();
}

exports.solve = solve;

'use strict';

function createReadLine() {
  process.stdin.resume();
  process.stdin.setEncoding('utf-8');

  let inputString = '';
  let currentLine = 0;

  process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
  });

  process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
      return string.trim();
    });

    main();
  });

  function readline() {
    return inputString[currentLine++];
  }

  return readline;
}

const readline = createReadLine();

function readInts(){
  return readline().split(' ').map((value => Number.parseInt(value)));
}

function readFloats(){
  return readline().split(' ').map((value => Number.parseFloat(value)));
}

function readStr() {
  return readline();
}

function readInt(){
  return Number.parseInt(readline());
}

function readFloat(){
  return Number.parseFloat(readline());
}

function main() {
  const str = readStr();
  const result = solve(str);
  console.log(result);
}

function solve(str){
  const strArr = str.toString().split('')
  let number = Number.parseInt(str);
  let counter = 0;
  while (number > 0){
    number = number - Math.max(...number.toString().split(''))
    counter ++;
  }
  return counter;
}

module.exports.solve = solve;

function check9(n) {
  const ns = n.toString();
  const indexOf9 = ns.indexOf("9");
  if (indexOf9 < 0) {
    return 0;
  }
  const rest = n % 10 ** (ns.length - indexOf9 - 1);
  const count = Math.floor(rest / 9);
  return count + 1;
}

function solve(n) {
  let rest = n;
  let count = 0;
  while (rest > 9) {
    const count9 = check9(rest);
    if (count9 > 0) {
      rest -= count9 * 9;
      count += count9;
    } else {
      rest -= Math.max(...rest.toString().split(""));
      count += 1;
    }

    // console.log(rest, count, count9)
  }
  return count + 1;
}

function* main() {
  const n = parseInt(yield);
  const r = solve(n);
  console.log(r);
  process.exit(0);
}

if (!module.parent) {
  (() => {
    const q = main();
    q.next();
    require("readline")
      .createInterface({
        input: process.stdin,
        output: null
      })
      .on("line", line => q.next(line));
  })();
}

exports.solve = solve;

let store = [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}];

function checkDigit(n, dig) {
  if (dig == 0) {
    return { count: n == 0 ? 0 : 1, decrement: 0 };
  }
  if (dig > n) {
    return {
      count: 1,
      decrement: dig - n
    };
  }
  return {
    count: 2,
    decrement: dig
  };
}

function getNumString(arr) {
  const joined = arr.join("");
  const trimmed = joined.replace(/0/g, " ").trimLeft();
  return trimmed.replace(/\s/g, "0") || "0";
}

function solveCore(n, dig = 0) {
  if (store[dig][n]) {
    return store[dig][n];
  }
  if (n.length === 1) {
    return (store[dig][n] = checkDigit(n, dig));
  }

  let first = n[0];
  let tailArr = n.substring(1).split("");
  let total = 0;

  while (first >= 0) {
    const r = solveCore(getNumString(tailArr), Math.max(first, dig));
    total += r.count;
    first -= 1;
    tailArr = tailArr.map(() => "9");
    tailArr.pop();
    tailArr.push(`${(10 - r.decrement) % 10}`);
  }

  return (store[dig][n] = { count: total, decrement: 10 - tailArr.pop() });
}

function solve(n) {
  store = [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}];
  const r = solveCore(n, 0);
  return r.count;
}

function* main() {
  const n = yield;
  const r = solve(n);
  console.log(r);
  process.exit(0);
}

if (!module.parent) {
  (() => {
    const q = main();
    q.next();
    require("readline")
      .createInterface({
        input: process.stdin,
        output: null
      })
      .on("line", line => q.next(line));
  })();
}

exports.solve = solve;

let store = [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}];

function checkDigit(n, dig) {
  if (dig == 0) {
    return { count: int(n == 0 ? 0 : 1), decrement: 0 };
  }
  if (dig > n) {
    return {
      count: int(1),
      decrement: dig - n
    };
  }
  return {
    count: int(2),
    decrement: dig
  };
}

function getNumString(arr) {
  const joined = arr.join("");
  const trimmed = joined.replace(/0/g, " ").trimLeft();
  return trimmed.replace(/\s/g, "0") || "0";
}

function solveCore(n, dig = 0) {
  if (store[dig][n]) {
    return store[dig][n];
  }
  if (n.length === 1) {
    return (store[dig][n] = checkDigit(n, dig));
  }

  let first = n[0];
  let tailArr = n.substring(1).split("");
  let total = int();

  while (first >= 0) {
    const r = solveCore(getNumString(tailArr), Math.max(first, dig));
    total = plus(total, r.count);
    first -= 1;
    tailArr = tailArr.map(() => "9");
    tailArr.pop();
    tailArr.push(`${(10 - r.decrement) % 10}`);
  }

  return (store[dig][n] = { count: total, decrement: 10 - tailArr.pop() });
}

function solve(n) {
  store = [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}];
  const r = solveCore(n, 0);
  console.log(
    n,
    store.map(o => Object.keys(o).length).reduce((acc, c) => acc + c)
  );
  return bintToString(r.count);
}

function* main() {
  const n = yield;
  const r = solve(n);
  console.log(r);
  process.exit(0);
}

if (!module.parent) {
  (() => {
    const q = main();
    q.next();
    require("readline")
      .createInterface({
        input: process.stdin,
        output: null
      })
      .on("line", line => q.next(line));
  })();
}

function int(n = 0) {
  return [
    n,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
  ];
}
function plus(int1, int2) {
  let z = 0;
  return int1.map((_, i) => {
    z = z + int1[i] + int2[i];
    const r = z % 10;
    z = Math.floor(z / 10);
    return r;
  });
}

function bintToString(i) {
  return getNumString(Array.from(i).reverse());
}

exports.solve = solve;


main();
function main() {
    var size = parseInt(readline());
    var array = readline().split(' ');
    if ((size==1) || (size==2)) {
        return print("YES");
    } else {
        for (var i=0; i<size; i++) {array[i] = parseInt(array[i]);}
        var state = (array[0]<array[1]) ? "up" : (array[0]==array[1] ? "const" : "down");
        if (state!="WRONG") {
            for (var i=2; i<size; i++) {
                if (state=="up") {
                    if (array[i-1]==array[i]) state="const"
                    else if (array[i-1]>array[i]) state="down";
                } else if (state=="const") {
                    if (array[i-1]<array[i]) return print("NO")
                    else if (array[i-1]>array[i]) state="down";
                } else {
                    if (array[i-1]<=array[i]) return print("NO");
                }
            }
        } else {
            return print("NO");
        }
        return print("YES");
    }
}

var n = readline()
var arr = readline().split(' ').map(x => parseInt(x))
var unimodal = 'YES'
var lastmov = null;

for(var i = 1; i < arr.length; i++){
	var curmov = arr[i] == arr[i - 1] ? 1 : arr[i] < arr[i - 1] ? 2 : 0;
	if(lastmov == null) { lastmov = curmov; continue; }
	if(curmov < lastmov) { unimodal = 'NO'; break; }
	lastmov = curmov;
}

print(unimodal)

var n = Number(readline());
var arr = readline().split(' ').map(Number);
var i = 1, prev = arr[0], cur = arr[1];

while (prev < cur) {
    i++;
    prev = cur;
    cur = arr[i];
}

while (prev == cur) {
    i++;
    prev = cur;
    cur = arr[i];
}

while (prev > cur) {
    i++;
    prev = cur;
    cur = arr[i];
}

if (i == arr.length) {
    print('YES');
}
else {print('NO');}

var aLength = parseInt(readline()),
    arr = readline().split(' '),
    lastElem = null,
    action = -1,
    output = 'YES';

if (aLength !== 1) {
    for (var i = 0; i < aLength; i++) {
        if (lastElem !== null) {
            if (lastElem > parseInt(arr[i])) {
                action = 2;

            } else if (lastElem === parseInt(arr[i])) {
                if(action === 2) {
                    output = 'NO';
                    break;
                }
                action = 1;

            } else {
                if(action === 1 || action === 2) {
                    output = 'NO';
                    break;
                }
                action = 0;
            }
        }

        lastElem = parseInt(arr[i]);
    }
}

print(output);

var n = readline();
var arr = readline().split(' ').map(x => parseInt(x));
var unimodal = 'YES';
var getconst = false;

for(var i = 1; i < arr.length; i++){

	if(!getconst) getconst = arr[i] <= arr[i- 1] ;

	if(arr[i] == arr[i- 1]) continue;

	if(!getconst && arr[i] < arr[i - 1]){
		unimodal = 'NO';
		break;
	}

	if(getconst && arr[i] > arr[i - 1]){
		unimodal = 'NO';
		break;
	}
}

print(unimodal);

var n = readline()
var arr = readline().split(' ').map(x => parseInt(x))
var unimodal = 'YES'
var getconst = false;

for(var i = 1; i < arr.length; i++){

	if(!getconst) getconst = arr[i] == arr[i- 1]

	if(arr[i] == arr[i- 1]) continue;

	if(!getconst && arr[i] < arr[i - 1]){
		unimodal = 'NO'
		break;
	}

	if(getconst && arr[i] > arr[i - 1]){
		unimodal = 'NO'
		break;
	}
}

print(unimodal)

var arr = readline().split(' ').map(x => parseInt(x))
var unimodal = 'YES'
var getconst = false;

for(var i = 1; i < arr.length; i++){

	if(!getconst) getconst = arr[i] <= arr[i- 1]

	if(arr[i] == arr[i- 1]) continue;

	if(!getconst && arr[i] < arr[i - 1]){
		unimodal = 'NO'
		break;
	}

	if(getconst && arr[i] > arr[i - 1]){
		unimodal = 'NO'
		break;
	}
}

print(unimodal)

main();
function main() {
    var size = parseInt(readline());
    var array = readline().split(' ');
    if ((size==1) || (size==2)) {
        return print("YES");
    } else {
        for (var i=0; i<size; i++) {array[i] = parseInt(array[i]);}
        var state = (array[0]<array[1]) ? "up" : (array[0]==array[1] ? "const" : "WRONG");
        if (state!="WRONG") {
            for (var i=2; i<size; i++) {
                if (state=="up") {
                    if (array[i-1]==array[i]) state="const"
                    else if (array[i-1]>array[i]) state="down";
                } else if (state=="const") {
                    if (array[i-1]<array[i]) return print("NO")
                    else if (array[i-1]>array[i]) state="down";
                } else {
                    if (array[i-1]<=array[i]) return print("NO");
                }
            }
        } else {
            return print("NO");
        }
        return print("YES");
    }
}

main();
function main() {
    var size = parseInt(readline());
    var array = readline().split(' ');
    if ((size==1) || (size==2)) {
        return print("YES");
    } else {
        var state = (array[0]<array[1]) ? "up" : (array[0]==array[1] ? "const" : "WRONG");
        if (state!="WRONG") {
            for (var i=2; i<size; i++) {
                if (state=="up") {
                    if (array[i-1]==array[i]) state="const"
                    else if (array[i-1]>array[i]) state="down";
                } else if (state=="const") {
                    if (array[i-1]<array[i]) return print("NO")
                    else if (array[i-1]>array[i]) state="down";
                } else {
                    if (array[i-1]<=array[i]) return print("NO");
                }
            }
        } else {
            return print("NO");
        }
        return print("YES");
    }
}

var aLength = parseInt(readline()),
    arr = readline().split(' '),
    lastElem = null,
    action = -1,
    output = 'YES';

if (aLength !== 1) {
    for (var i = 0; i < aLength; i++) {
        if (lastElem !== null) {
            if (lastElem > arr[i]) {
                if(action === -1) {
                    output = 'NO';
                    break;
                }
                action = 2;

            } else if (lastElem === arr[i]) {
                if(action === 2) {
                    output = 'NO';
                    break;
                }
                action = 1;

            } else {
                if(action === 1 || action === 2) {
                    output = 'NO';
                    break;
                }
                action = 0;
            }
        }

        lastElem = arr[i];
    }
}

print(output);

var aLength = parseInt(readline()),
    arr = readline().split(' '),
    lastElem = null,
    action = -1,
    output = 'YES';

if (aLength !== 1) {
    for (var i = 0; i < aLength; i++) {
        if (lastElem !== null) {
            if (lastElem > parseInt(arr[i])) {
                if(action === -1) {
                    output = 'NO';
                    break;
                }
                action = 2;

            } else if (lastElem === parseInt(arr[i])) {
                if(action === 2) {
                    output = 'NO';
                    break;
                }
                action = 1;

            } else {
                if(action === 1 || action === 2) {
                    output = 'NO';
                    break;
                }
                action = 0;
            }
        }

        lastElem = parseInt(arr[i]);
    }
}

print(output);


var xy = readline().split(' ').map(Number);
var x = xy[0], y = xy[1];
var x1 = 0, y1 = 0, x2 = 0, y2 = 0;
if (x > 0) {
    x2 = x + Math.abs(y);
    if (y > 0) y1 = x2;
    else y1 = -x2;
} else {
    x1 = x - Math.abs(y);
    if (y > 0) y2 = -x1;
    else y2 = x1;
}
print(x1, y1, x2, y2);

print(function(x, y){
	var dx = Math.abs(x);
	var dy = Math.abs(y);
	var d = dx+dy;
	var a = [ d*x/dx, 0 ];
	var b = [ 0, d*y/dy ];
	return ( x<0 ? a.concat(b) : b.concat(a) ).join(' ');
}.apply(0, readline().split(' ').map(Number)));

function trim(s) {
	return s.replace(/^\s+|\s+$/gm, '');
}

function tokenize(s) {
	return trim(s).split(/\s+/);
}

function tokenizeIntegers(s) {
	var tokens = tokenize(s);
	for (var i = 0; i < tokens.length; i += 1) {
		tokens[i] = parseInt(tokens[i], 10);
	};
	return tokens;
}

function main() {
	var data = tokenizeIntegers(readline()),
		a = data[0], b = data[1],
		x = Math.abs(a) + Math.abs(b),
		y = x;
	x *= a/Math.abs(a);
	y *= b/Math.abs(b);
	if (x < 0) {
		print(x, 0, 0, y);
	} else {
		print(0, y, x, 0);
	}
}

main();