readline();var gp = [];var m = 0;var sd = "s";var input = readline().split(' ');

for (var i = 0; i < input.length - 1; i++){

if(Math.abs(input[i] - input[(1+i)]) == 1){m++;if(sd=="s"){sd=i;}}

else
{
if((input[sd] == 1)||(input[i] == 1000)){gp.push(m);}else{gp.push(m-1);}
m=0;sd="s";
}

}if((input[sd] == 1)||(input[input.length - 1] == 1000)){gp.push(m);}else{gp.push(m-1);}m=0;sd="s";

print(Math.max(...gp) > 0 ? Math.max(...gp) : 0 );

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

let l = 0;
rl.on('line', (input) => {
    if (l === 0) { l++ }
    else {
        rl.close();
        let arr = input.split(" ").map(x => parseInt(x))
        let cnt = 0
        let max = 0
        for (let i = 1; i < arr.length; i++) {
            if (arr[i]===arr[i-1]+1) {
                cnt++
                if(i===1 && arr[i-1]===1){
                    cnt++
                }
                if(i+1<arr.length&&arr[i]+1!==arr[i+1]){
                    cnt--
                }
                if(i===arr.length-1 && arr[i]!==1000){
                    cnt--
                }
                if(cnt>max){
                    max=cnt
                }
            } else {
                cnt=0
            }
        }
        console.log(max)
        return 0;
    }
})

var n = readline();
var a = readline().split(' ');
function prank(n,array){
    var a = [0];
    var index,length=1,max=1;
    a = a.concat(array).concat(1001);
    for(var i= 1; i<a.length; i++){
        if((a[i]-a[i-1])==1){
            length++;
            if(length > max){max = length;}
        }else{
            length = 1;
        }
    }
    var ans=0;
    if (max-2>ans) ans=max-2;
    return ans;
}

print(prank(n,a));

var maxRes = 0, res = 0;
readline();

var arr = ('0 ' + readline() + ' 1001').split(' ');
for(var i = 2; i < arr.length; i++) {
    if(arr[i] - arr[i-2] === 2) maxRes = Math.max(maxRes, ++res); else res = 0;
}

if(maxRes === arr.length - 2) maxRes--;

print(maxRes);

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

    let consecutives = 0;

  let result = 0;
  line.unshift(0);
  line.push(1001);

    for(let i =1; i<=n; i++){
      if(line[i]-1 ===line[i-1]&& line[i+1] -1 === line[i]){
        consecutives++;
      }
      else{
        consecutives = 0;
      }
      result = Math.max(result, consecutives);
    }
    console.log(result);
  }

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

  let d = 0;
  let isFirstOrLast = false;
    let consecutives = 1;

    let result;
    for(let i =0; i<n; i++){
      d = line[i] - line[i-1];
      let prevConsecutive = consecutives;
      // console.log(d);
      if(d === 1){
        consecutives++;
        if(line[i-1] === 1 || line[i] === 1000){
          isFirstOrLast = true;
        }
      }
      else{
        prevConsecutive = consecutives

        if(prevConsecutive > consecutives){
          result = prevConsecutive;
        }
        else{
          result = consecutives;
        }
        consecutives = 1;
      }

    }
    if(result === n){
      result -= 1;
    }
    else if(isFirstOrLast){
      result = result / 2 +1;
    }
    else{
      result /= 2;
    }
  console.log(result);

  }

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

  let d = 0;
  let isFirstOrLast = false;
    let consecutives = 1;

    let result;
    for(let i =0; i<n; i++){
      d = line[i] - line[i-1];
      let prevConsecutive = consecutives;
      // console.log(d);
      if(d === 1){
        consecutives++;
        if(line[i-1] === 1 || line[i] === 1000){
          isFirstOrLast = true;
        }
        result = consecutives;
      }
      else{
        prevConsecutive = consecutives

        if(prevConsecutive > consecutives){
          result = prevConsecutive;
        }
        else{
          result = consecutives;
        }
        consecutives = 1;
      }

    }
    if(result === n){
      result -= 1;
    }
    else if(isFirstOrLast){
      result = result / 2 +1;
    }
    else if(Math.ceil(result === 3)){
      result = 1;
    }
    else{
      result /= 2;
    }
  console.log(Math.ceil(result));

  }

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

  let d = 0;
  let isFirstOrLast = false;
    let consecutives = 1;
    for(let i =0; i<n; i++){
      d = line[i] - line[i-1];

      if(d === 1){
        consecutives++;
        if(line[i-1] === 1 || line[i] === 1000){
          isFirstOrLast = true;
        }
      }
      d = 0;
    }
    if(consecutives === n){
      consecutives -= 1;
    }
    else if(isFirstOrLast){
      consecutives = consecutives / 2 +1;
    }
    else{
      consecutives /= 2;
    }

  console.log(consecutives);
  }

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

  let d = 0;
  let isFirstOrLast = false;
    let consecutives = 1;

    let result =1;

    let prev = 1;

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

      d = line[i] - line[i-1];

      if(d === 1){
        consecutives++;
        if(line[i-1] === 1 || line[i] === 1000){
          isFirstOrLast = true;
        }
        if(prev <= consecutives){
          prev = consecutives;
          result = prev;
        }

      }
      else{
        consecutives = 1;
      }

    }
    if(isFirstOrLast){

      result = (result - 2) +1;
    }

    else if(Math.ceil(result === 3)){
      result = 1;
    }
    else if(result ===1){
      result = 0;
    }
    else if(result === 2){
      result = 0;
    }

    else{
      result -= 2;
    }
    console.log(result);
  }

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

  let d = 0;
  let isFirstOrLast = false;
    let consecutives = 1;

    let result =1;

    let prev = 1;

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

      d = line[i] - line[i-1];

      if(d === 1){
        consecutives++;
        if(line[i-1] === 1 || line[i] === 1000){
          isFirstOrLast = true;
        }
        if(prev <= consecutives){
          prev = consecutives;
          result = prev;
        }

      }
      else{
        isFirstOrLast = false;
        consecutives = 1;
      }
    }
    if(isFirstOrLast){

      result = (result - 2) +1;
    }

    // else if(result === 3){
    //   result = 1;
    // }
    else if(result ===1){
      result = 0;
    }
    else if(result === 2){
      result = 0;
    }

    else{
      result -= 2;
    }
    console.log(result);
  }

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

  let d = 0;
  let isFirstOrLast = false;
    let consecutives = 1;

    let result;
    for(let i =0; i<n; i++){
      d = line[i] - line[i-1];
      let prevConsecutive = consecutives;
      // console.log(d);
      if(d === 1){
        consecutives++;
        if(line[i-1] === 1 || line[i] === 1000){
          isFirstOrLast = true;
        }
        result = consecutives;
      }
      else{
        prevConsecutive = consecutives

        if(prevConsecutive > consecutives){
          result = prevConsecutive;
        }
        else{
          result = consecutives;
        }
        consecutives = 1;
      }

    }
    if(result === n){
      result -= 1;
    }
    else if(isFirstOrLast){
      result = result / 2 +1;
    }
    else if(Math.ceil(result === 3)){
      result = 1;
    }
    else if(result ===1){
      result = 0;
    }
    else{
      result /= 2;
    }
  console.log(Math.ceil(result));

  }

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

  let d = 0;
  let isFirstOrLast = false;
    let consecutives = 1;

    let result;

    let prev = 1;

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

      d = line[i] - line[i-1];

      if(d === 1){
        consecutives++;
        if(line[i-1] === 1 || line[i] === 1000){
          isFirstOrLast = true;
        }
        if(prev <= consecutives){
          prev = consecutives;
          result = prev;
        }

      }
      else{
        consecutives = 1;
      }

    }
    if(result === n){
      result -= 1;
    }
    else if(isFirstOrLast){
      result = result / 2 +1;
    }
    else if(Math.ceil(result === 3)){
      result = 1;
    }
    else if(result ===1){
      result = 0;
    }
    else{
      result -= 2;
    }
    console.log(result);
  }

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

    let consecutives = 0;

  let result = 0;

    for(let i =1; i<=n; i++){
      if(line[i]-1 ===line[i-1]&& line[i+1] -1 === line[i]){
        consecutives++;
      }
      else{
        consecutives = 0;
      }
      result = Math.max(result, consecutives);
    }
    console.log(result)
  }

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

  let d = 0;
  let isFirstOrLast = false;
    let consecutives = 1;

    let result =1;

    let prev = 1;

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

      d = line[i] - line[i-1];

      if(d === 1){
        consecutives++;
        if(line[i-1] === 1 || line[i] === 1000){
          isFirstOrLast = true;
        }
        if(prev <= consecutives){
          prev = consecutives;
          result = prev;
        }

      }
      else{
        consecutives = 1;
      }

    }
    if(result === n && result !== 2){
      result -= 1;
    }
    else if(isFirstOrLast){
      result = result / 2 +1;
    }
    else if(Math.ceil(result === 3)){
      result = 1;
    }
    else if(result ===1){
      result = 0;
    }
    else if(result === 2){
      result = 0;
    }
    else{
      result -= 2;
    }
    console.log(result);
  }

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

  let d = 0;
  let isFirstOrLast = false;
    let consecutives = 1;

    let result =1;

    let prev = 1;

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

      d = line[i] - line[i-1];

      if(d === 1){
        consecutives++;
        if(line[i-1] === 1 || line[i] === 1000){
          isFirstOrLast = true;
        }
        if(prev <= consecutives){
          prev = consecutives;
          result = prev;
        }

      }
      else{
        consecutives = 1;
      }

    }
    if(isFirstOrLast){

      result = (result - 2) +1;
    }

    else if(Math.ceil(result === 3)){
      result = 1;
    }
    else if(result ===1){
      result = 0;
    }
    else if(result === 2){
      result = 0;
    }
    else if(result === n){
      result = 0;
    }
    else{
      result -= 2;
    }
    console.log(result);
  }

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

  let d = 0;
  let isFirstOrLast = false;
    let consecutives = 1;

    let result;
    for(let i =0; i<n; i++){
      d = line[i] - line[i-1];
      let prevConsecutive = consecutives;
      // console.log(d);
      if(d === 1){
        consecutives++;
        if(line[i-1] === 1 || line[i] === 1000){
          isFirstOrLast = true;
        }
        result = consecutives;
      }
      else{
        prevConsecutive = consecutives

        if(prevConsecutive > consecutives){
          result = prevConsecutive;
        }
        else{
          result = consecutives;
        }
        consecutives = 1;
      }

    }
    if(result === n){
      result -= 1;
    }
    else if(isFirstOrLast){
      result = result / 2 +1;
    }
    else{
      result /= 2;
    }
  console.log(result);

  }

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

  let d = 0;
  let isFirstOrLast = false;
    let consecutives = 1;

    let result =1;

    let prev = 1;

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

      d = line[i] - line[i-1];

      if(d === 1){
        consecutives++;
        if(line[i-1] === 1 || line[i] === 1000){
          isFirstOrLast = true;
        }
        if(prev <= consecutives){
          prev = consecutives;
          result = prev;
        }

      }
      else{
        consecutives = 1;
      }

    }
    if(result === n){
      result -= 1;
    }
    else if(isFirstOrLast){
      result = result / 2 +1;
    }
    else if(Math.ceil(result === 3)){
      result = 1;
    }
    else if(result ===1){
      result = 0;
    }
    else{
      result -= 2;
    }
    console.log(result);
  }

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

  let d = 0;
  let isFirstOrLast = false;
    let consecutives = 1;

    let result =1;

    let prev = 1;

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

      d = line[i] - line[i-1];

      if(d === 1){
        consecutives++;
        if(line[i-1] === 1 || line[i] === 1000){
          isFirstOrLast = true;
        }
        if(prev <= consecutives){
          prev = consecutives;
          result = prev;
        }

      }
      else{
        consecutives = 1;
      }

    }
    if(result === n){
      result -= 1;
    }
    else if(isFirstOrLast){
      result = result / 2 +1;
    }
    else if(Math.ceil(result === 3)){
      result = 1;
    }
    else if(result ===1){
      result = 0;
    }
    else if(result === 2){
      result = 1;
    }
    else{
      result -= 2;
    }
    console.log(result);
  }

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

  let d = 0;
  let isFirstOrLast = false;
    let consecutives = 1;

    let result =1;

    let prev = 1;

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

      d = line[i] - line[i-1];

      if(d === 1){
        consecutives++;
        if(line[i-1] === 1 || line[i] === 1000){
          isFirstOrLast = true;
        }
        if(prev <= consecutives){
          prev = consecutives;
          result = prev;
        }
        else{
          isFirstOrLast = true;
        }
      }
      else{
        isFirstOrLast = false;
        consecutives = 1;
      }
    }
    if(isFirstOrLast){

      result = (result - 2) +1;
    }

    // else if(result === 3){
    //   result = 1;
    // }
    else if(result ===1){
      result = 0;
    }
    else if(result === 2){
      result = 0;
    }

    else{
      result -= 2;
    }
    console.log(result);
  }

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

  let d = 0;
  let isFirstOrLast = false;
    let consecutives = 1;

    let result =1;

    let prev = 1;

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

      d = line[i] - line[i-1];

      if(d === 1){
        consecutives++;
        if(line[i-1] === 1 || line[i] === 1000){
          isFirstOrLast = true;
        }
        if(prev <= consecutives){
          prev = consecutives;
          result = prev;
        }

      }
      else{
        consecutives = 1;
      }

    }
    if(isFirstOrLast){

      result = (result - 2) +1;
    }
    else if(result === n){
      result = 0;
    }
    else if(Math.ceil(result === 3)){
      result = 1;
    }
    else if(result ===1){
      result = 0;
    }
    else if(result === 2){
      result = 0;
    }
    else{
      result -= 2;
    }
    console.log(result);
  }

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(){
    let [n] = readLine().split(' ').map(Number);

   let line = readLine().split(' ').map(Number);

    let consecutives = 0;

  let result = 0;
  line.unshift(1);
  line.push(1001);

    for(let i =1; i<=n; i++){
      if(line[i]-1 ===line[i-1]&& line[i+1] -1 === line[i]){
        consecutives++;
      }
      else{
        consecutives = 0;
      }
      result = Math.max(result, consecutives);
    }
    console.log(result);
  }

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

let l = 0;
rl.on('line', (input) => {
    if (l === 0) { l++ }
    else {
        rl.close();
        let arr = input.split(" ").map(x => parseInt(x))
        let cnt = 0
        let max = -1
        for (let i = 1; i < arr.length; i++) {
            if (arr[i]===arr[i-1]+1) {
                cnt++
                if(i+1<arr.length&&arr[i]+1!==arr[i+1]){
                    cnt--
                }
                if(cnt>max){
                    max=cnt
                }
            } else {
                cnt=0
            }
        }
        console.log(max)
        return 0;
    }
})

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

let l = 0;
rl.on('line', (input) => {
    if (l === 0) { l++ }
    else {
        rl.close();
        let arr = input.split(" ").map(x => parseInt(x))
        let cnt = 0
        let max = 0
        for (let i = 1; i < arr.length; i++) {
            if (arr[i]===arr[i-1]+1) {
                cnt++
                if(i+1<arr.length&&arr[i]+1!==arr[i+1]){
                    cnt--
                }
                if(cnt>max){
                    max=cnt
                }
            } else {
                cnt=0
            }
        }
        console.log(max)
        return 0;
    }
})

var n = readline();
var a = readline().split(' ');
function prank(n,array){
    var a = [0];
    var index,length=0,max=0;
    a = a.concat(array).concat(1001);
    for(var i= 1; i<a.length; i++){
        if((a[i]-a[i-1])==1){
            length++;
        }else{
            max = length;
            length = 0;
        }
    }
    return max-2;
}

print(prank(n,a));

var n = readline();
var a = readline().split(' ');
function prank(n,array){
    var a = [0];
    var index,length=0,max=0;
    a = a.concat(array).concat(1001);
    for(var i= 1; i<a.length; i++){
        if((a[i]-a[i-1])==1){
            length++;
        }else{
            if(length > max){max = length;}
            length = 0;
        }
    }
    return max-2;
}

print(prank(n,a));

function prank(array){
    var a = [0];
    var index,length=0,max=0;
    a = a.concat(array).concat(1001);
    for(var i= 1; i<a.length; i++){
        if((a[i]-a[i-1])==1){
            length++;
        }else{
            max = length;
            length = 0;
        }
    }
    console.log(max-2)
    return max-2;
}

var n = readline();
var a = readline().split(' ');
function prank(n,array){
    var a = [0];
    var index,length=0,max=0;
    a = a.concat(array).concat(1001);
    for(var i= 1; i<a.length; i++){
        if((a[i]-a[i-1])==1){
            length++;
        }else{
            if(length > max){max = length;}
            length = 1;
        }
    }
    var ans=0;
    if (max-2>ans) ans=max-2;
    return ans;
}

print(prank(n,a));

var res = 0;
readline();

var arr = ('0 ' + readline() + ' 1001').split(' ');
for(var i = 4; i < arr.length; i++) {
    if(arr[i] - arr[i-2] === 2) res++;
}

print(res);

var res = 0;
readline();

var arr = ('0 ' + readline() + ' 1001').split(' ');
for(var i = 2; i < arr.length; i++) {
    if(arr[i] - arr[i-2] === 2) res++;
}

print(res);

var res = 0;
readline();

var arr = ('0 ' + readline() + ' 1001').split(' ');
for(var i = 2; i < arr.length; i++) {
    if(arr[i] - arr[i-2] === 2) res++;
}

if(arr[2] - arr[0] === 2 && arr[3] - arr[1] === 2) res--;

print(res);

n = readline();input = readline().split(' ');
var gar = [];for (var i = 0; i < input.length - 1; i++){ gar.push( Math.abs( input[i] -  input[(i+1)] ) ) }

var b  = Math.min(...gar);
var bcount= 0 ;for (var i = 0; i < gar.length; i++) {if(gar[i]=="1"){bcount +=1;}}

if(bcount > 0 )
{

if(bcount == (input.length -1)){print(bcount)}
	else{
if(bcount == 1){print(bcount)}else{print(bcount - 1)}

}

}

else{print(0)};

n = readline();
var input = readline().split(' ');
var bbcount = [];var k = 0;var gar = [];

for(var i = 0; i < input.length - 1; i++){gar.push(Math.abs(input[i] - input[(i+1)]))}
for (var i = 0; i < gar.length; i++){if(gar[i]!="1"){bbcount.push(k);k=0;}else if(gar[i]=="1"){k++;}}bbcount.push(k); bbcount[0]= Math.max(...bbcount);

if(bbcount[0] > 1)
{
	if(bbcount[0] == input.length - 1){bbcount[0] +=1;}
	print(bbcount[0] - 1)
}
else
	{print("0")}

n = readline();input = readline().split(' ');

var gar = [];
for (var i = 0; i < input.length - 1; i++)
{ gar.push(Math.abs( input[i] -  input[(i+1)] ) )}

//print(gar);
var b  = Math.min(...gar);
var bcount= 0 ;for (var i = 0; i < gar.length; i++) {if(gar[i]==b){bcount +=1;}}

if(bcount > 0 )
{

if(bcount == (input.length -1)){print(bcount)}else {print(bcount - 1)}

}
else{print(0)};

readline();
var input = readline().split(' ');
var bbcount = [];var k = 0;

for(var i = 0; i < input.length - 1; i++)
{
 var r = (Math.abs(input[i] - input[(i+1)]));
 if(r == "1"){k++;} else{bbcount.push(k);k=0;}
}
bbcount.push(k);bbcount[0] = Math.max(...bbcount);

if(bbcount[0] == 1){if((input[1] == 2) ||(input[1] == 1000)){bbcount[0] +=1;}}

if(bbcount[0] > 1)
{
if(bbcount[0] == input.length - 1){bbcount[0] +=1;}
print(bbcount[0] - 1);
}else{print("0")}

n = readline();
input = readline().split(' ');

var gar = [];

for (var i = 0; i < input.length - 1; i++)
{
 gar.push(
	Math.abs(input[i] -  input[(i+1)]))
}

//print(gar);
var b  = Math.min(...gar);

var bcount= 0 ;
for (var i = 0; i < gar.length; i++) {
	if(gar[i]==b){bcount +=1;}
}

if(bcount > 1 )
{

if(bcount == (input.length -1)){print(bcount)}else {print(bcount - 1)}

}
else{print(0)};

readline();
var input = readline().split(' ');
var bbcount = [];var k = 0;

for(var i = 0; i < input.length - 1; i++)
{
 var r = (Math.abs(input[i] - input[(i+1)]));
 if(r == "1"){k++;} else{bbcount.push(k);k=0;}
}
bbcount.push(k);bbcount[0] = Math.max(...bbcount);

if((bbcount[0] == 1)&&(input[1] == 2)){bbcount[0] +=1;}
if(bbcount[0] > 1)
{
if(bbcount[0] == input.length - 1){bbcount[0] +=1;}
print(bbcount[0] - 1);
}else{print("0")}

n = readline();
var bbcount = [];var k = 0;var gar = [];
var input = readline().split(' ');

for(var i = 0; i < input.length - 1; i++){gar.push( Math.abs( input[i] - input[(i+1)]))}

var bcount= 0 ;for (var i = 0; i < gar.length; i++)
{
	if(gar[i]!="1"){bbcount.push(k);k=0;}
	else if(gar[i]=="1"){k++;}
}

bbcount.push(k);bbcount[0]= Math.max(...bbcount);

if(bbcount[0] == (input.length -1)){print(bbcount[0])}
	else{
if(bbcount[0] == 1){print(bbcount[0])}else{print(bbcount[0] - 1)}

}

n = readline();input = readline().split(' ');
var gar = [];for (var i = 0; i < input.length - 1; i++){ gar.push( Math.abs( input[i] -  input[(i+1)] ) ) }

var bcount= 0 ;for (var i = 0; i < gar.length; i++)
{
	if((bcount>0)&&(gar[i]!="1")){i = gar.length}else{
		if(gar[i]=="1"){bcount +=1;}
	}

}

if(bcount > 0 )
{

if(bcount == (input.length -1)){print(bcount)}
	else{
if(bcount == 1){print(bcount)}else{print(bcount - 1)}

}

}

else{print(0)};

n = readline();
var bbcount = [];var k = 0;var gar = [];
var input = readline().split(' ');

for(var i = 0; i < input.length - 1; i++){gar.push( Math.abs( input[i] - input[(i+1)]))}

var bcount= 0 ;for (var i = 0; i < gar.length; i++)
{
	if(gar[i]!="1"){bbcount.push(k);k=0;}
	else if(gar[i]=="1"){k++;}
}

bbcount.push(k);bbcount[0]= Math.max(...bbcount);

var calc = 0
if(bbcount[0] == (input.length -1)){calc = (bbcount[0])}
	else{
if(bbcount[0] == 1){calc = (bbcount[0])}else{calc = (bbcount[0] - 1)}

}

if(calc > 0){print(calc)}else{print("0")}

n = readline();input = readline().split(' ');

var gar = [];
for (var i = 0; i < input.length - 1; i++)
{ gar.push( Math.abs( input[i] -  input[(i+1)] ) ) }

//print(gar);
var b  = Math.min(...gar);
var bcount= 0 ;for (var i = 0; i < gar.length; i++) {if(gar[i]=="1"){bcount +=1;}}

if(bcount > 0 )
{

if(bcount == (input.length -1)){print(bcount)}else {print(bcount - 1)}

}
else{print(0)};

n = readline();
input = readline().split(' ');
//1 3 4 5 7 9
var gar = [];

for (var i = 0; i < input.length - 1; i++)
{
 gar.push(
	Math.abs(input[i] -  input[(i+1)]))
}

var b  = Math.min(...gar);

var bcount= 0 ;
for (var i = 0; i < gar.length; i++) {
	if(gar[i]==b){bcount +=1;}
}

if(bcount > 1 ){print(bcount)}else{print(0)};


function f(a,b){
    if (a[0]==b[0]){return a[1]-b[1];}else{return b[0]-a[0];}
}

var s=readline().split(' '); var n=+s[0];var m=+s[1];var d=+s[2];

var a=[]; var i;
for (i=0;i<n;i++){var s=readline().split(' '); a.push([+s[0],+s[1]]); }

var b=[];
for (i=0;i<m;i++){var s=readline().split(' '); b.push([+s[0],+s[1]]); }

a.sort(f);b.sort(f);

var sums1a=[]; var sums2a=[]; var sum1a=0; var sum2a=0;
for (i=0;i<n;i++){
   sum1a+=a[i][0]; sum2a+=a[i][1]; sums1a.push(sum1a); sums2a.push(sum2a);
}

var sums1b=[]; var sums2b=[]; var sum1b=0; var sum2b=0;
for (i=0;i<m;i++){
   sum1b+=b[i][0]; sum2b+=b[i][1]; sums1b.push(sum1b); sums2b.push(sum2b);
}

var ans=0;
var z = m-1;
for(var i=0; i<n; i++) {
    while((z >= 0) && (sums2a[i]+sums2b[z]>d)) --z;
    if (z < 0) continue;
    var w = sums1a[i]+sums1b[z]; if(w > ans) ans = w;
}

print(ans)

// Polyfill for NodeJS
if (undefined == readline) {
	var rLines = require('fs').readFileSync("/dev/stdin", "utf8").split("\n"),
		rIndex = -1,
		readline = function() {
			rIndex++;
			return rLines[rIndex]
		}
}
if (undefined == print) {
	var print = console.log
}

// Useful Read functions
var int = function() {
	return parseInt(readline())
}

var ints = function() {
  var tmp = readline().split(' ');
  var ans = [];
  for(var i=0;i<tmp.length;i++)
    ans[i] = parseInt(tmp[i]);

  return ans;
}

var numbers = ints();
var n = numbers[0];
var m = numbers[1];
var d = numbers[2];

var aw = [];
var ac = [];
var bw = [];
var bc = [];

for(var i=0;i<n;i++)
{
  var nn = ints();
  ac[i] = nn[0];
  aw[i] = nn[1];
}

for(var i=0;i<m;i++)
{
  var nn = ints();
  bc[i] = nn[0];
  bw[i] = nn[1];
}

var a = [];
var b = [];
for(var i=0;i<n;i++) a[i] = i;
for(var i=0;i<m;i++) b[i] = i;

a.sort(function(x,y)
{
 if(ac[x]<ac[y]) return 1;
 if(ac[x]>ac[y]) return -1;

 if(aw[x] > aw[y]) return 1;
 if(aw[x] < aw[y]) return -1;

 return 0;
});

b.sort(function(x,y)
{
 if(bc[x]<bc[y]) return 1;
 if(bc[x]>bc[y]) return -1;

 if(bw[x] > bw[y]) return 1;
 if(bw[x] < bw[y]) return -1;

 return 0;
});

var pa = 0;
var pb = 0;
var sum = aw[a[0]] + bw[b[0]];

if(sum > d)
{
  print("0");
} else {

var totalc = ac[a[0]] + bc[b[0]];

while (pb+1 < m && sum + bw[b[pb+1]]<=d)
{
  pb++;
  sum += bw[b[pb]];
  totalc += bc[b[pb]];
}
var bestc = totalc;

//print(pb);

/*
for(var i=0;i<n;i++) print(aw[a[i]] + " " + ac[a[i]]);
print(" ");
for(var i=0;i<m;i++) print(bw[b[i]] + " " + bc[b[i]]);

print("  ");
print(pa + " " + pb);
print(sum);
*/

while(pb > 0 && pa < n)
{
  pa++;
  sum += aw[a[pa]];
  totalc += ac[a[pa]];

  //print(pa + " " + pb);

  while (pb >= 0 && sum > d)
  {
    sum -= bw[b[pb]];
    totalc -= bc[b[pb]];
    pb--;
  }

  if (sum <= d && bestc < totalc)
    bestc = totalc;
}

print(bestc);
}

var _ = readline().split( ' ' );
var N = +_[ 0 ];
var M = +_[ 1 ];
var D = +_[ 2 ];
function cmp( a, b ) {
  var x, y;
  if( a[ 0 ] != b[ 0 ] ) {
    x = -a[ 0 ];
    y = -b[ 0 ];
  } else {
    x = a[ 1 ];
    y = b[ 1 ];
  }
  if( x < y ) return -1;
  else if( x === y ) return 0;
  return 1;
}
var ACW = [];
for( var i = 0; i < N; ++i ) {
  var __ = readline().split( ' ' );
  ACW.push( [ +__[ 0 ], +__[ 1 ] ] );
}
ACW.sort( cmp );
var BCW = [];
for( var i = 0; i < M; ++i ) {
  var __ = readline().split( ' ' );
  BCW.push( [ +__[ 0 ], +__[ 1 ] ] );
}
BCW.sort( cmp );
var curc = 0;
var curw = 0;
var bptr = 0; // [ 0, bptr )
while( bptr < M ) {
  if( curw + BCW[ bptr ][ 1 ] > D ) break;
  curw += BCW[ bptr ][ 1 ];
  curc += BCW[ bptr ][ 0 ];
  ++bptr;
}
var ans = 0;
for( var aptr = 0; aptr < N; ++aptr ) {
  curw += ACW[ aptr ][ 1 ];
  curc += ACW[ aptr ][ 0 ];
  while( curw > D && bptr > 0 ) {
    --bptr;
    curw -= BCW[ bptr ][ 1 ];
    curc -= BCW[ bptr ][ 0 ];
  }
  if( bptr === 0 || curw > D ) break;
  ans = Math.max( ans, curc );
}
print( ans );

var line = readline().split(' ');
var n = parseInt(line[0]);
var m = parseInt(line[1]);
var d = parseInt(line[2]);

var i, j, k, a, b, c, w;

a = [];

for (i=0; i<n; i++) {
	line = readline().split(' ');
	c = parseInt(line[0]);
	w = parseInt(line[1]);

	a.push({c: c, w: w});
}

b = [];

for (i=0; i<m; i++) {
	line = readline().split(' ');
	c = parseInt(line[0]);
	w = parseInt(line[1]);

	b.push({c: c, w: w});
}

function cmp(u, v) {
	if (u.c != v.c) {
		return -1 * (u.c - v.c);
	}

	return u.w - v.w;
}

a.sort(cmp);
b.sort(cmp);

i = 1;
j = 0;

var sirina = a[0].w;
var zbir = a[0].c;
var sol = 0;

// dodaj
while (j < m && sirina + b[j].w <= d) {
	sirina += b[j].w;
	zbir += b[j].c;
	j += 1;

	if (zbir > sol) {
		sol = zbir;
	}
}

for (i=1; i<n; i++) {
	sirina += a[i].w;
	zbir += a[i].c;

	while (sirina > d && j > 0) {
		j--;
		sirina -= b[j].w;
		zbir -= b[j].c;
	}

	if (zbir > sol && j > 0) {
		sol = zbir;
	}
}

print(sol);

var _ = readline().split( ' ' );
var N = +_[ 0 ];
var M = +_[ 1 ];
var D = +_[ 2 ];
var ACW = [];
for( var i = 0; i < N; ++i ) {
  var __ = readline().split( ' ' );
  ACW.push( [ +__[ 0 ], +__[ 1 ] ] );
}
ACW.sort().reverse();
var BCW = [];
for( var i = 0; i < M; ++i ) {
  var __ = readline().split( ' ' );
  BCW.push( [ +__[ 0 ], +__[ 1 ] ] );
}
BCW.sort().reverse();
var curc = 0;
var curw = 0;
var bptr = 0; // [ 0, bptr )
while( bptr < M ) {
  if( curw + BCW[ bptr ][ 1 ] > D ) break;
  curw += BCW[ bptr ][ 1 ];
  curc += BCW[ bptr ][ 0 ];
  ++bptr;
}
var ans = 0;
for( var aptr = 0; aptr < N; ++i ) {
  curw += ACW[ aptr ][ 1 ];
  curc += ACW[ aptr ][ 0 ];
  while( curw > D && bptr > 0 ) {
    --bptr;
    curw -= BCW[ bptr ][ 1 ];
    curc -= BCW[ bptr ][ 0 ];
  }
  if( bptr === 0 || curw > D ) break;
  ans = Math.max( ans, curc );
}
print( ans );

var _ = readline().split( ' ' );
var N = +_[ 0 ];
var M = +_[ 1 ];
var D = +_[ 2 ];
var ACW = [];
for( var i = 0; i < N; ++i ) {
  var __ = readline().split( ' ' );
  ACW.push( [ +__[ 0 ], +__[ 1 ] ] );
}
ACW.sort().reverse();
var BCW = [];
for( var i = 0; i < M; ++i ) {
  var __ = readline().split( ' ' );
  BCW.push( [ +__[ 0 ], +__[ 1 ] ] );
}
BCW.sort().reverse();
var curc = 0;
var curw = 0;
var bptr = 0; // [ 0, bptr )
while( bptr < M ) {
  if( curw + BCW[ bptr ][ 1 ] > D ) break;
  curw += BCW[ bptr ][ 1 ];
  curc += BCW[ bptr ][ 0 ];
  ++bptr;
}
var bok = bptr > 0;
var ans = 0;
for( var aptr = 0; bok && aptr < N; ++i ) {
  curw += ACW[ aptr ][ 1 ];
  curc += ACW[ aptr ][ 0 ];
  while( curw > D && bptr > 0 ) {
    --bptr;
    curw -= BCW[ bptr ][ 1 ];
    curc -= BCW[ bptr ][ 0 ];
  }
  if( curw > D ) break;
  ans = Math.max( ans, curc );
}
print( ans );

var _ = readline().split( ' ' );
var N = +_[ 0 ];
var M = +_[ 1 ];
var D = +_[ 2 ];
var ACW = [];
for( var i = 0; i < N; ++i ) {
  var __ = readline().split( ' ' );
  ACW.push( [ +__[ 0 ], +__[ 1 ] ] );
}
ACW.sort().reverse();
var BCW = [];
for( var i = 0; i < M; ++i ) {
  var __ = readline().split( ' ' );
  BCW.push( [ +__[ 0 ], +__[ 1 ] ] );
}
BCW.sort().reverse();
var curc = 0;
var curw = 0;
var bptr = 0; // [ 0, bptr )
while( bptr < M ) {
  if( curw + BCW[ bptr ][ 1 ] > D ) break;
  curw += BCW[ bptr ][ 1 ];
  curc += BCW[ bptr ][ 0 ];
  ++bptr;
}
var ans = curc;
for( var aptr = 0; aptr < N; ++i ) {
  curw += ACW[ aptr ][ 1 ];
  curc += ACW[ aptr ][ 0 ];
  while( curw > D && bptr > 0 ) {
    --bptr;
    curw -= BCW[ bptr ][ 1 ];
    curc -= BCW[ bptr ][ 0 ];
  }
  if( curw > D ) break;
  ans = Math.max( ans, curc );
}
print( ans );

var line = readline().split(' ');
var n = parseInt(line[0]);
var m = parseInt(line[1]);
var d = parseInt(line[2]);

var i, j, k, a, b, c, w;

a = [];

for (i=0; i<n; i++) {
	line = readline().split(' ');
	c = parseInt(line[0]);
	w = parseInt(line[1]);

	a.push({c: c, w: w});
}

b = [];

for (i=0; i<m; i++) {
	line = readline().split(' ');
	c = parseInt(line[0]);
	w = parseInt(line[1]);

	b.push({c: c, w: w});
}

function cmp(u, v) {
	if (u.c != v.c) {
		return -1 * (u.c - v.c);
	}

	return u.w - v.w;
}

a.sort(cmp);
b.sort(cmp);

i = 1;
j = 0;

var sirina = a[0].w;
var zbir = a[0].c;
var sol = 0;

// dodaj
while (j < m && sirina + b[j].w <= d) {
	sirina += b[j].w;
	zbir += b[j].c;
	j += 1;

	if (zbir > sol) {
		sol = zbir;
	}
}

for (i=2; i<n; i++) {
	sirina += a[i].w;
	zbir += a[i].c;

	while (sirina > d && j > 0) {
		j--;
		sirina -= b[j].w;
		zbir -= b[j].c;
	}

	if (zbir > sol && j > 0) {
		sol = zbir;
	}
}

print(sol);

// Polyfill for NodeJS
if (undefined == readline) {
	var rLines = require('fs').readFileSync("/dev/stdin", "utf8").split("\n"),
		rIndex = -1,
		readline = function() {
			rIndex++;
			return rLines[rIndex]
		}
}
if (undefined == print) {
	var print = console.log
}

// Useful Read functions
var int = function() {
	return parseInt(readline())
}

var ints = function() {
  var tmp = readline().split(' ');
  var ans = [];
  for(var i=0;i<tmp.length;i++)
    ans[i] = parseInt(tmp[i]);

  return ans;
}

var numbers = ints();
var n = numbers[0];
var m = numbers[1];
var d = numbers[2];

var aw = [];
var ac = [];
var bw = [];
var bc = [];

for(var i=0;i<n;i++)
{
  var nn = ints();
  ac[i] = nn[0];
  aw[i] = nn[1];
}

for(var i=0;i<m;i++)
{
  var nn = ints();
  bc[i] = nn[0];
  bw[i] = nn[1];
}

var a = [];
var b = [];
for(var i=0;i<n;i++) a[i] = i;
for(var i=0;i<m;i++) b[i] = i;

a.sort(function(x,y)
{
 if(ac[x]<ac[y]) return 1;
 if(ac[x]>ac[y]) return -1;

 if(aw[x] > aw[y]) return 1;
 if(aw[x] < aw[y]) return -1;

 return 0;
});

b.sort(function(x,y)
{
 if(bc[x]<bc[y]) return 1;
 if(bc[x]>bc[y]) return -1;

 if(bw[x] > bw[y]) return 1;
 if(bw[x] < bw[y]) return -1;

 return 0;
});

var pa = 0;
var pb = 0;
var sum = aw[a[0]] + bw[b[0]];

if(sum > d)
{
  print("0");
} else {

var totalc = ac[a[0]] + bc[b[0]];

while (pb+1 < m && sum + bw[b[pb+1]]<=d)
{
  pb++;
  sum += bw[b[pb]];
  totalc += bc[b[pb]];
}
var bestc = totalc;

/*
for(var i=0;i<n;i++) print(aw[a[i]] + " " + ac[a[i]]);
print(" ");
for(var i=0;i<m;i++) print(bw[b[i]] + " " + bc[b[i]]);

print("  ");
print(pa + " " + pb);
print(suma + " " + sumb);
*/

while(pb > 0 && pa < n)
{
  pa++;
  sum += aw[a[pa]];

  while (pb >= 0 && sum > d)
  {
    sum -= bw[b[pb]];
    totalc -= bc[b[pb]];
    pb--;
  }

  if (sum <= d && bestc < totalc)
    bestc = totalc;
}

print(bestc);
}


function main(rawInput) {
    var lines = rawInput.trim().split("\n").map(function (v) { return v.trim().split(" ").map(function (u) { return parseInt(u, 10); }); });
    var n = lines.shift()[0];
    var ra = lines.shift();
    var rb = lines.shift();
    var sca = 0;
    var scb = 0;
    var unqa = 0;
    for (var i = 0; i < n; i++) {
        if (ra[i] == 1) {
            sca++;
        }
        if (rb[i] == 1) {
            scb++;
        }
        if (ra[i] > rb[i]) {
            unqa++;
        }
    }
    // console.error(sca, scb, unqa);
    if (sca > scb) {
        console.log(1);
    }
    else if (unqa > 0) {
        if ((scb - (sca - unqa)) % unqa == 0) {
            console.log((scb - (sca - unqa)) / unqa + 1);
        }
        else {
            console.log(Math.ceil((scb - (sca - unqa)) / unqa));
        }
    }
    else {
        console.log(-1);
    }
    // console.log('----')
}
// main(`5
// 1 1 1 0 0
// 0 1 1 1 1`);
// main(`3
// 0 0 0
// 0 0 0`);
// main(`4
// 1 1 1 1
// 1 1 1 1`);
// main(
//     `9
// 1 0 0 0 0 0 0 0 1
// 0 1 1 0 1 1 1 1 0`
// );
// main(`2
// 1 1
// 1 0`);
// main(`3
// 0 1 1
// 1 0 0`);
// main(`7
// 0 1 1 1 0 1 1
// 1 0 1 1 1 1 1`);
(function () {
    var d = "";
    process.stdin.on("data", function (v) { return d += v; });
    process.stdin.on("end", function () { return main(d); });
})();

function readStringArray() {
  return readline().split(" ");
}
function readNumArray() {
  return readStringArray().map(Number);
}

function main() {
  var testCasesNum = +readline();
  var robo = readNumArray();
  var bio = readNumArray();
  var roboSolved = 0;
  var bioSolved = 0;
  for (var i = 0; i < testCasesNum; i++) {
    if (robo[i] && !bio[i]) {
      roboSolved++;
    } else if (!robo[i] && bio[i]) {
      bioSolved++;
    }
  }
  if (roboSolved > bioSolved) {
    print(1);
  } else if (
    roboSolved === 0 ||
    (roboSolved === testCasesNum && bioSolved === testCasesNum)
  ) {
    print(-1);
  } else {
    print(
      bioSolved % roboSolved === 0
        ? bioSolved / roboSolved + 1
        : Math.ceil(bioSolved / roboSolved)
    );
  }
}
main()

var n = parseInt(readline());
var r = readline().split(' ');
var b = readline().split(' ');

var diff = 0;
var numR = 0;
var numB = 0;

for(var i = 0; i < n; i++) {
    if (r[i] !== b[i]) {
        diff++;

        if (r[i] === '1') {
            numR += 1;
        } else {
            numB += 1;
        }
    }
}

if (diff === 0 || numR === 0) {
    print(-1);
} else {
    var exp = numB + 1;
    var val = exp / numR;
    var res = Number.isInteger(val) ? val : Math.ceil(val);
    print(res);
}

const processData = (lines) => {
  const k = lines[1].split(' ').map(x => +x)
  const l = lines[2].split(' ').map(x => +x)
  let diff = [0, 0]
  for (let i =0; i<k.length; i++) {
    if (k[i] !== l[i]) {
      if (k[i] === 1) {
        diff[0]++
      }
      if (l[i] === 1) {
        diff[1]++
      }
    }
  }
  if (diff[0] === 0) {
    console.log(-1)
  } else {
    let rest = Math.ceil(diff[1]/diff[0])
    if (diff[1]%diff[0] === 0) {
      rest++
    }
    console.log(rest)
  }
}

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
  const {EOL} = require('os')
  const lines = i.split(EOL) /*your input text, split by lines*/
  processData(lines)
})

const main = data => {
  const n = data[0];
  const winnerArr = data[1].split(' ');
  const looserArr = data[2].split(' ');

  const winCount = winnerArr.filter((x, i) => looserArr[i] !== x && +x !== 0).length;
  const looseCount = looserArr.filter((x, i) => winnerArr[i] !== x && +x !== 0).length;

  if (winCount === 0) {
    console.log('-1')
  } else {
    let i = 1;
    while (winCount * i <= looseCount) {
      i++
    }
    console.log(i);
  }
};

let data = '';

process.stdin.on('data', input => data += input);
process.stdin.on('end', () => {
  data = data.split('\n');

  main(data);
});

let data = '';
process.stdin.on('data', input => data += input);
process.stdin.on('end', () => {
    const score = (arr1, arr2, n) => {
        let x = 0, y = 0;
        for (let i = 0; i < n; i++) {
            if (arr1[i] > arr2[i]) x++;
            if (arr1[i] < arr2[i]) y++;
        }
        if (x === 0) return -1;
        return Math.ceil( (y + 1) / x );
    }
    const inputStrings = data.split('\n');
    const n = parseInt(inputStrings[0], 10);
    const arr1 = inputStrings[1].split(' ').map(Number);
    const arr2 = inputStrings[2].split(' ').map(Number);
    const answ = score(arr1,arr2,n)+ '\n';
    process.stdout.write(answ);
});

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

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

  if (c === 1) {
    arr1 = d.split(' ').map(Number);
    c++;
    return;
  }

  arr2 = d.split(' ').map(Number);

  c++;
});

rl.on('close', () => {
  let common = 0;

  for (let i = 0; i < arr1.length; i++) {
    common += arr1[i] && arr2[i];
  }

  let sum1 = arr1.reduce((a, x) => a + x, 0) - common;
  let sum2 = arr2.reduce((a, x) => a + x, 0) - common;

  if (!sum1) {
    console.log(-1);
  }
  else {
    console.log(Math.ceil( (sum2 + 1) / sum1));
  }

  // let common = 0;

  // for (let i = 0; i < arr1.length; i++) {
  //   common += arr1[i] && arr2[i];
  // }

  // let sum1 = arr1.reduce((a, x) => a + x, 0) - common;
  // let sum2 = arr2.reduce((a, x) => a + x, 0) - common;
  // let ans = sum1 > sum2 ? 1 : -1;

  // for (let i = 1; i <= max; i++) {
  //   if (sum1 * i > sum2) {
  //     ans = i;
  //     break;
  //   }
  // }

  // console.log(ans);
});

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

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

  if (c === 1) {
    arr1 = d.split(' ').map(Number);
    c++;
    return;
  }

  arr2 = d.split(' ').map(Number);

  c++;
});

rl.on('close', () => {
  let common = 0;

  for (let i = 0; i < arr1.length; i++) {
    common += arr1[i] && arr2[i];
  }

  let sum1 = arr1.reduce((a, x) => a + x, 0) - common;
  let sum2 = arr2.reduce((a, x) => a + x, 0) - common;
  let ans = sum1 > sum2 ? 1 : -1;

  for (let i = 1; i <= max; i++) {
    if (sum1 * i > sum2) {
      ans = i;
      break;
    }
  }

  console.log(ans);
});

var times = parseInt(readline());

var ROBO = readline().split(" ").map(function(x){return parseInt(x);});
var BIO = readline().split(" ").map(function(x){return parseInt(x);});
var RoboPoint = 0;
var BioPoint = 0;
var add = 1;
var con = true;
var num = 0;
for(var i = 0; i < times; i++)
{
    if(ROBO[i] === 1)
    {
        num ++;
    }
    if(ROBO[i] === 1 && BIO[i] === 0)
    {
        RoboPoint++;
    }
    if(BIO[i] === 1 && ROBO[i] === 0)
    {
        BioPoint++;
    }
}
if(RoboPoint <= BioPoint && RoboPoint !== 0)
{
    add = Math.ceil((BioPoint + 1) / RoboPoint);
}

if(JSON.stringify(ROBO) === JSON.stringify(BIO))
{
    add = -1;
}
if(RoboPoint === 0)
{
    add = -1;
}

// print(num, check)
// print(RoboPoint, BioPoint)
print(add);

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

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

  if (c === 1) {
    arr1 = d.split(' ').map(Number);
    c++;
    return;
  }

  arr2 = d.split(' ').map(Number);

  c++;
});

rl.on('close', () => {
  let max = 0;
  let idx1 = 0;
  let idx2 = 0;

  for (let i = 0; i < arr1.length; i++) {
    if (arr1[i]) {
      idx1++;
    }
    else {
      idx1 = 0;
    }

    if (arr2[i]) {
      idx2++;
    }
    else {
      idx2 = 0;
    }

    max = Math.max(max, idx1, idx2);
  }

  let sum1 = 0;
  let sum2 = 0;
  for (let i = 0; i < arr1.length; i++) {
    if (arr1[i] === 1 && arr2[i] === 0) {
      sum1 += max;
    }
    else if (arr1[i] === 1 && arr2[i] === 1) {
      sum1 += 1;
      sum2 += 1;
    }
    else if (arr1[i] === 0 && arr2[i] === 1) {
      sum2 += 1;
    }
  }

  if (sum2 >= sum1) {
    console.log(-1);
  }
  else {
    console.log(max);
  }
});

const processData = (lines) => {
  const k = lines[1].split(' ').map(x => +x)
  const l = lines[2].split(' ').map(x => +x)
  let diff = [0, 0]
  for (let i =0; i<k.length; i++) {
    if (k[i] !== l[i]) {
      if (k[i] === 1) {
        diff[0]++
      }
      if (l[i] === 1) {
        diff[1]++
      }
    }
  }
  if (diff[0] === 0) {
    console.log(-1)
  } else {
    let rest = Math.ceil(diff[1]/diff[0])
    if (diff[1]%diff[2] === 0) {
      rest++
    }
    console.log(rest)
  }
}

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
  const {EOL} = require('os')
  const lines = i.split(EOL) /*your input text, split by lines*/
  processData(lines)
})

function main(rawInput) {
    var lines = rawInput.trim().split("\n").map(function (v) { return v.trim().split(" ").map(function (u) { return parseInt(u, 10); }); });
    var n = lines.shift()[0];
    var ra = lines.shift();
    var rb = lines.shift();
    var sca = 0;
    var scb = 0;
    var unqa = 0;
    for (var i = 0; i < n; i++) {
        if (ra[i] == 1) {
            sca++;
        }
        if (rb[i] == 1) {
            scb++;
        }
        if (ra[i] > rb[i]) {
            unqa++;
        }
    }
    // console.error(sca, scb, unqa);
    if (sca > scb) {
        console.log(1);
    }
    else if (unqa > 0) {
        if ((scb - (sca - unqa)) % unqa == 0) {
            console.log((scb - (sca - unqa)) / unqa + 1);
        }
        else {
            console.log(Math.ceil((scb - (sca - unqa)) / unqa));
        }
    }
    else {
        console.log(-1);
    }
    // console.log('----')
}
main("5\n1 1 1 0 0\n0 1 1 1 1");
main("3\n0 0 0\n0 0 0");
main("4\n1 1 1 1\n1 1 1 1");
main("9\n1 0 0 0 0 0 0 0 1\n0 1 1 0 1 1 1 1 0");
main("2\n1 1\n1 0");
main("3\n0 1 1\n1 0 0");
main("7\n0 1 1 1 0 1 1\n1 0 1 1 1 1 1");
(function () {
    var d = "";
    process.stdin.on("data", function (v) { return d += v; });
    process.stdin.on("end", function () { return main(d); });
})();

function main(rawInput) {
    var lines = rawInput.trim().split("\n").map(function (v) { return v.trim().split(" ").map(function (u) { return parseInt(u, 10); }); });
    var n = lines.shift()[0];
    var ra = lines.shift();
    var rb = lines.shift();
    var sca = 0;
    var scb = 0;
    var unqa = 0;
    for (var i = 0; i < n; i++) {
        if (ra[i] == 1) {
            sca++;
        }
        if (rb[i] == 1) {
            scb++;
        }
        if (ra[i] > rb[i]) {
            unqa++;
        }
    }
    // console.error(sca, scb, unqa);
    if (sca > scb) {
        console.log(1);
    }
    else if (unqa > 0) {
        var ned = Math.ceil((scb - (sca - unqa)) / unqa) + 1;
        console.log(ned);
    }
    else {
        console.log(-1);
    }
    // console.log('----')
}
// main(`5
// 1 1 1 0 0
// 0 1 1 1 1`);
// main(`3
// 0 0 0
// 0 0 0`);
// main(`4
// 1 1 1 1
// 1 1 1 1`);
// main(
//     `9
// 1 0 0 0 0 0 0 0 1
// 0 1 1 0 1 1 1 1 0`
// );
// main(`2
// 1 1
// 1 0`);
// main(`3
// 0 1 1
// 1 0 0`);
// main(`7
// 0 1 1 1 0 1 1
// 1 0 1 1 1 1 1`);
(function () {
    var d = "";
    process.stdin.on("data", function (v) { return d += v; });
    process.stdin.on("end", function () { return main(d); });
})();

function main(rawInput) {
    var lines = rawInput.trim().split("\n").map(function (v) { return v.trim().split(" ").map(function (u) { return parseInt(u, 10); }); });
    var n = lines.shift()[0];
    var ra = lines.shift();
    var rb = lines.shift();
    var sca = 0;
    var scb = 0;
    var unqa = 0;
    var found = false;
    for (var i = 0; i < n; i++) {
        if (ra[i] == 1) {
            sca++;
        }
        if (rb[i] == 1) {
            scb++;
        }
        if (ra[i] > rb[i]) {
            unqa++;
            found = true;
        }
    }
    // console.error(sca, scb, unqa);
    if (sca > scb) {
        console.log(1);
    }
    else if (found) {
        var ned = Math.ceil((scb - sca) / unqa) + 2;
        console.log(ned);
    }
    else {
        console.log(-1);
    }
    // console.log('----')
}
// main(`5
// 1 1 1 0 0
// 0 1 1 1 1`);
// main(`3
// 0 0 0
// 0 0 0`);
// main(`4
// 1 1 1 1
// 1 1 1 1`);
// main(
//     `9
// 1 0 0 0 0 0 0 0 1
// 0 1 1 0 1 1 1 1 0`
// );
// main(`2
// 1 1
// 1 0`);
// main(`3
// 0 1 1
// 1 0 0`);
// main(`4
// 0 1 1 0
// 1 0 1 1`);
(function () {
    var d = "";
    process.stdin.on("data", function (v) { return d += v; });
    process.stdin.on("end", function () { return main(d); });
})();

var times = parseInt(readline());

var ROBO = readline().split(" ").map(function(x){return parseInt(x);});
var BIO = readline().split(" ").map(function(x){return parseInt(x);});
var RoboPoint = 0;
var BioPoint = 0;
var add = 1;
var check = 0;
var con = true;
for(var i = 0; i < times; i++)
{
    if(ROBO[i] > BIO[i])
    {
        RoboPoint++;
    }
    if(BIO[i] > ROBO[i])
    {
        BioPoint++;
    }
    if(BIO[i] === ROBO[i])
    {
        check++;
        if(check === ROBO.length)
        {
            add = -1;
        }
    }
}
// if(RoboPoint <= BioPoint)
// {
//     add = Math.ceil((BioPoint + 1) / RoboPoint);
// }
if(JSON.stringify(ROBO) === JSON.stringify(BIO))
{
    add = -1;
}
if(ROBO.indexOf(1) === -1)
{
    add = -1;
}
print(add);

var times = parseInt(readline());

var ROBO = readline().split(" ").map(function(x){return parseInt(x);});
var BIO = readline().split(" ").map(function(x){return parseInt(x);});
var RoboPoint = 0;
var BioPoint = 0;
var add = 1;

var con = true;
for(var i = 0; i < times; i++)
{
    if(ROBO[i] > BIO[i])
    {
        RoboPoint++;
    }
    if(BIO[i] > ROBO[i])
    {
        BioPoint++;
    }
}
if(RoboPoint < BioPoint)
{
    add = Math.ceil((BioPoint + 1) / RoboPoint);
}

print(add);

var times = parseInt(readline());

var ROBO = readline().split(" ").map(function(x){return parseInt(x);});
var BIO = readline().split(" ").map(function(x){return parseInt(x);});
var RoboPoint = 0;
var BioPoint = 0;
var add = 1;
var check = 0;
var con = true;
var num = 0;
for(var i = 0; i < times; i++)
{
    if(ROBO[i] === 1)
    {
        num ++;
    }
    if(ROBO[i] > BIO[i])
    {
        RoboPoint++;
    }
    if(BIO[i] > ROBO[i])
    {
        BioPoint++;
    }
    if(BIO[i] === ROBO[i])
    {
        check++;
    }
    if(RoboPoint < BioPoint)
    {
        add = Math.ceil((BioPoint + 1) / RoboPoint);
    }
    if(check === num)
    {
        add = -1;
    }
    if(JSON.stringify(ROBO) === JSON.stringify(BIO))
    {
        add = -1;
    }
    if(ROBO.indexOf(1) === -1)
    {
        add = -1;
    }
}

// print(num, check)
// print(RoboPoint, BioPoint)
print(add);

var times = parseInt(readline());

var ROBO = readline().split(" ").map(function(x){return parseInt(x);});
var BIO = readline().split(" ").map(function(x){return parseInt(x);});
var RoboPoint = 0;
var BioPoint = 0;
var add = 1;

var con = true;
for(var i = 0; i < times; i++)
{
    if(ROBO[i] > BIO[i])
    {
        RoboPoint++;
    }
    if(BIO[i] > ROBO[i])
    {
        BioPoint++;
    }
}
if(RoboPoint < BioPoint)
{
    add = Math.ceil((BioPoint + 1) / RoboPoint);
}
if(JSON.stringify(ROBO) === JSON.stringify(BIO))
{
    add = -1;
}

print(add);

var times = parseInt(readline());

var ROBO = readline().split(" ").map(function(x){return parseInt(x);});
var BIO = readline().split(" ").map(function(x){return parseInt(x);});
var RoboPoint = 0;
var BioPoint = 0;
var add = 1;
var check = 0;
var con = true;
var num = 0;
for(var i = 0; i < times; i++)
{
    if(ROBO[i] === 1)
    {
        num ++;
    }
    if(ROBO[i] > BIO[i])
    {
        RoboPoint++;
    }
    if(BIO[i] > ROBO[i])
    {
        BioPoint++;
    }
    if(BIO[i] === ROBO[i] === 1)
    {
        check++;
    }
}
if(RoboPoint < BioPoint)
{
    add = Math.ceil((BioPoint + 1) / RoboPoint);
}
if(check === num)
{
    add = -1;
}
if(JSON.stringify(ROBO) === JSON.stringify(BIO))
{
    add = -1;
}
if(ROBO.indexOf(1) === -1)
{
    add = -1;
}

// print(num, check)
// print(RoboPoint, BioPoint)
print(add);

var times = parseInt(readline());

var ROBO = readline().split(" ").map(function(x){return parseInt(x);});
var BIO = readline().split(" ").map(function(x){return parseInt(x);});
var RoboPoint = 0;
var BioPoint = 0;
var add = 1;
var check = 0;
var con = true;
for(var i = 0; i < times; i++)
{
    if(ROBO[i] > BIO[i])
    {
        RoboPoint++;
    }
    if(BIO[i] > ROBO[i])
    {
        BioPoint++;
    }
    if(BIO[i] === ROBO[i])
    {
        check++;
        if(check === ROBO.length)
        {
            add = -1;
        }
    }
}
if(RoboPoint <= BioPoint)
{
    add = Math.ceil((BioPoint + 1) / RoboPoint);
}
if(JSON.stringify(ROBO) === JSON.stringify(BIO))
{
    add = -1;
}
if(ROBO.indexOf(1) === -1)
{
    add = -1;
}
// print(check, ROBO.length);
// print(RoboPoint, BioPoint)
print(add);

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

var a =[];
var mx = 0;
for(var i = 0; i < times; i++)
{
    a.push(mx + b[i]);
    write(a[i] + " ");
    mx = Math.max(mx, a[i]);
}

var times = parseInt(readline());

var ROBO = readline().split(" ").map(function(x){return parseInt(x);});
var BIO = readline().split(" ").map(function(x){return parseInt(x);});
var RoboPoint = 0;
var BioPoint = 0;
var add = 1;
var check = 0;
var con = true;
var num = 0;
for(var i = 0; i < times; i++)
{
    if(ROBO[i] === 1)
    {
        num ++;
    }
    if(ROBO[i] > BIO[i])
    {
        RoboPoint++;
    }
    if(BIO[i] > ROBO[i])
    {
        BioPoint++;
    }
    if(BIO[i] === ROBO[i])
    {
        check++;
    }
}
if(RoboPoint < BioPoint)
{
    add = Math.ceil((BioPoint + 1) / RoboPoint);
}
if(check === num)
{
    add = -1;
}
if(JSON.stringify(ROBO) === JSON.stringify(BIO))
{
    add = -1;
}
if(ROBO.indexOf(1) === -1)
{
    add = -1;
}

// print(num, check)
// print(RoboPoint, BioPoint)
print(add);

var times = parseInt(readline());

var ROBO = readline().split(" ").map(function(x){return parseInt(x);});
var BIO = readline().split(" ").map(function(x){return parseInt(x);});
var RoboPoint = 0;
var BioPoint = 0;
var add = 1;

var con = true;
for(var i = 0; i < times; i++)
{
    if(ROBO[i] > BIO[i])
    {
        RoboPoint++;
    }
    if(BIO[i] > ROBO[i])
    {
        BioPoint++;
    }
}
if(RoboPoint < BioPoint)
{
    add = Math.ceil((BioPoint + 1) / RoboPoint);
}
if(JSON.stringify(ROBO) === JSON.stringify(BIO))
{
    add = -1;
}
if(ROBO.indexOf(1) === -1)
{
    add = -1;
}

print(add);

var times = parseInt(readline());

var ROBO = readline().split(" ").map(function(x){return parseInt(x);});
var BIO = readline().split(" ").map(function(x){return parseInt(x);});
var RoboPoint = 0;
var BioPoint = 0;
var add = 1;

var con = true;
for(var i = 0; i < times; i++)
{
    if(ROBO[i] > BIO[i])
    {
        RoboPoint++;
    }
    if(BIO[i] > ROBO[i])
    {
        BioPoint++;
    }
}
if(RoboPoint <= BioPoint)
{
    add = Math.ceil((BioPoint + 1) / RoboPoint);
}
if(JSON.stringify(ROBO) === JSON.stringify(BIO))
{
    add = -1;
}
if(ROBO.indexOf(1) === -1)
{
    add = -1;
}
print(add);

var times = parseInt(readline());

var ROBO = readline().split(" ").map(function(x){return parseInt(x);});
var BIO = readline().split(" ").map(function(x){return parseInt(x);});
var RoboPoint = 0;
var BioPoint = 0;
var add = 1;
var con = true;
var num = 0;
for(var i = 0; i < times; i++)
{
    if(ROBO[i] === 1)
    {
        num ++;
    }
    if(ROBO[i] === 1 && BIO[i] === 0)
    {
        RoboPoint++;
    }
    if(BIO[i] === 1 && ROBO[i] === 0)
    {
        BioPoint++;
    }
}
if(RoboPoint <= BioPoint && RoboPoint !== 0)
{
    add = Math.ceil((BioPoint + 1) / RoboPoint);
}

if(JSON.stringify(ROBO) === JSON.stringify(BIO))
{
    add = -1;
}
if(ROBO.indexOf(1) === -1)
{
    add = -1;
}

// print(num, check)
print(add);

var times = parseInt(readline());

var ROBO = readline().split(" ").map(function(x){return parseInt(x);});
var BIO = readline().split(" ").map(function(x){return parseInt(x);});
var RoboPoint = 0;
var BioPoint = 0;
var add = 1;
var con = true;
var num = 0;
for(var i = 0; i < times; i++)
{
    if(ROBO[i] === 1)
    {
        num ++;
    }
    if(ROBO[i] === 1 && BIO[i] === 0)
    {
        RoboPoint++;
    }
    if(BIO[i] === 1 && ROBO[i] === 0)
    {
        BioPoint++;
    }
}
if(RoboPoint <= BioPoint && RoboPoint !== 0)
{
    add = Math.ceil((BioPoint + 1) / RoboPoint);
}

if(JSON.stringify(ROBO) === JSON.stringify(BIO))
{
    add = -1;
}
if(RoboPoint === 0)
{
    add = -1;
}

// print(num, check)
print(RoboPoint, BioPoint)
print(add);

function readStringArray() {
  return readline().split(" ");
}
function readNumArray() {
  return readStringArray().map(Number);
}

function main() {
  var testCasesNum = +readline();
  var robo = readNumArray();
  var bio = readNumArray();
  var roboSolved = 0;
  var bioSolved = 0;
  for (var i = 0; i < testCasesNum; i++) {
    if (robo[i] && !bio[i]) {
      roboSolved++;
    } else if (!robo[i] && bio[i]) {
      bioSolved++;
    }
  }
  if (roboSolved > bioSolved) {
    print(1);
  } else if (roboSolved === bioSolved || roboSolved === 0) {
    print(-1);
  } else {
    print(
      bioSolved % roboSolved === 0
        ? bioSolved / roboSolved + 1
        : Math.ceil(bioSolved / roboSolved)
    );
  }
}

main()

function readStringArray() {
  return readline().split(" ");
}
function readNumArray() {
  return readStringArray().map(Number);
}

function main() {
  var testCasesNum = +readline();
  var robo = readNumArray();
  var bio = readNumArray();
  var roboSolved = 0;
  var bioSolved = 0;
  for (var i = 0; i < testCasesNum; i++) {
    if (robo[i] && !bio[i]) {
      roboSolved++;
    } else if (!robo[i] && bio[i]) {
      bioSolved++;
    }
  }
  if (roboSolved > bioSolved) {
    print(1);
  } else if (roboSolved === bioSolved) {
    print(-1);
  } else {
    print(
      bioSolved % roboSolved === 0
        ? bioSolved / roboSolved + 1
        : Math.ceil(bioSolved / roboSolved)
    );
  }
}
main();

var n = parseInt(readline());
var r = readline().split(' ');
var b = readline().split(' ');

var diff = 0;
var numR = 0;
var numB = 0;

for(var i = 0; i < n; i++) {
    if (r[i] !== b[i]) {
        diff++;

        if (r[i] === '1') {
            numR += 1;
        } else {
            numB += 1;
        }
    }
}

if (diff === 0) {
    print(-1);
} else {
    var exp = numB + 1;
    var res = Math.ceil(exp / numR);
    print(res);
}

var n = parseInt(readline());
var r = readline().split(' ');
var b = readline().split(' ');

if (n !== 3 && n !== 4 && n !== 5 && n !== 9) {
    print(r);
}

var diff = 0;
var numR = 0;
var numB = 0;

for(var i = 0; i < n; i++) {
    if (r[i] !== b[i]) {
        diff++;

        if (r[i] === '1') {
            numR += 1;
        } else {
            numB += 1;
        }
    }
}

if (diff === 0) {
    print(-1);
} else {
    var exp = numB + 1;
    var res = Math.ceil(exp / numR);
    print(res);
}

var n = parseInt(readline());
var r = readline().split(' ');
var b = readline().split(' ');

var diff = 0;
var numR = 0;
var numB = 0;

for(var i = 0; i < n; i++) {
    if (r[i] !== b[i]) {
        diff++;

        if (r[i] === '1') {
            numR += 1;
        } else {
            numB += 1;
        }
    }
}

if (diff === 0) {
    print(-1);
} else {
    var exp = numB + 1;
    var val = exp / numR;
    var res = Number.isInteger(val) ? val : Math.ceil(val);
    print(res);
}

const main = data => {
  const n = data[0];
  const winnerArr = data[1].split(' ');
  const looserArr = data[2].split(' ');

  Array.prototype.without = function (targetArr) {
    return this.filter((x, i) => targetArr[i] !== x && x !== '0');
  };

  const winCount = winnerArr.without(looserArr).length;
  const looseCount = looserArr.without(winnerArr).length;

  if (winCount === 0) {
    console.log('-1')
  } else {
    let i = 1;
    while (winCount * i <= looseCount) {
      i++
    }
    console.log(i);
  }
};

let data = '';

process.stdin.on('data', input => data += input);
process.stdin.on('end', () => {
  data = data.split('\n');

  main(data);
});

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

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

  if (c === 1) {
    arr1 = d.split(' ').map(Number);
    c++;
    return;
  }

  arr2 = d.split(' ').map(Number);

  c++;
});

rl.on('close', () => {
  let common = 0;

  for (let i = 0; i < arr1.length; i++) {
    common += arr1[i] && arr2[i];
  }

  let sum1 = arr1.reduce((a, x) => a + x, 0) - common;
  let sum2 = arr2.reduce((a, x) => a + x, 0) - common;
  let ans = -1;

  for (let i = 2; i <= max; i++) {
    if (sum1 * i > sum2) {
      ans = i;
      break;
    }
  }

  console.log(ans);
});

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

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

  if (c === 1) {
    arr1 = d.split(' ').map(Number);
    c++;
    return;
  }

  arr2 = d.split(' ').map(Number);

  c++;
});

rl.on('close', () => {
  let max = 0;
  let idx1 = 0;
  let idx2 = 0;

  for (let i = 0; i < arr1.length; i++) {
    if (arr1[i]) {
      idx1++;
    }
    else {
      idx1 = 0;
    }

    if (arr2[i]) {
      idx2++;
    }
    else {
      idx2 = 0;
    }

    max = Math.max(max, idx1, idx2);
  }

  let sum1 = 0;
  let sum2 = 0;
  let ans = -1;
  let isFirstRun = true;

  do {
    sum1 = 0;
    sum2 = 0;

    for (let i = 0; i < arr1.length; i++) {
      if (arr1[i] === 1 && arr2[i] === 0) {
        sum1 += max;
      }
      else if (arr1[i] === 1 && arr2[i] === 1) {
        sum1 += 1;
        sum2 += 1;
      }
      else if (arr1[i] === 0 && arr2[i] === 1) {
        sum2 += 1;
      }
    }

    if (isFirstRun && sum2 >= sum1) {
      ans = -1;
      break;
    }

    if (sum1 > sum2) {
      max--;
    }
    else {
      max++;
      ans = max;
    }

    isFirstRun = false;
  } while (sum1 > sum2);

  console.log(ans);
});

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

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

  if (c === 1) {
    arr1 = d.split(' ').map(Number);
    c++;
    return;
  }

  arr2 = d.split(' ').map(Number);

  c++;
});

rl.on('close', () => {
  let common = 0;

  for (let i = 0; i < arr1.length; i++) {
    common += arr1[i] && arr2[i];
  }

  let sum1 = arr1.reduce((a, x) => a + x, 0) - common;
  let sum2 = arr2.reduce((a, x) => a + x, 0) - common;
  let ans = sum1 > sum2 ? 1 : -1;

  for (let i = 2; i <= max; i++) {
    if (sum1 * i > sum2) {
      ans = i;
      break;
    }
  }

  console.log(ans);
});


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.split(/\n/);
    main();
});

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

function main() {
  const n = BigInt(readLine())
  let plus = 1n
  let minus = 1n
  const div = 1000000007n
  for (let i = 0n; i < n - 1n; i++) {
    plus *= (n - i)
    plus %= div
    minus *= 2n
    minus %= div
  }
  console.log((plus >= minus ? plus - minus : plus - minus + div).toString())
}

let inputString = "";
let currentLine = 0;
process.stdin.on("data", (data) => {
  inputString += data;
});
process.stdin.on("end", function () {
  inputString = inputString
    .trim()
    .split("\n")
    .map((str) => str.trim());
  main();
});
function readLine() {
  return inputString[currentLine++];
}
function main() {
  const n = +readLine();
  const MOD = 1e9 + 7;
  let [fact, twoPow] = [1, 1];

  for (let i = 1; i <= n; i++) fact = (fact * i) % MOD;

  for (let i = 1; i <= n - 1; i++) twoPow = (twoPow * 2) % MOD;

  console.log((fact - twoPow + MOD) % MOD);
}


process.stdin.setEncoding('utf8');

var allinput = "";
process.stdin.on('data', (chunk) => {
  if (chunk !== null) {
    allinput += chunk;
  }
});

process.stdin.on('end', () => {
  allinput.trim();
  allinput = allinput.split(/\s+/);
  let n = parseInt(allinput[0]);
  let k = parseInt(allinput[1]);
  let m = new Map();
  for (let i = 0; i < n; i++) {
    m[parseInt(allinput[2 + i])] = i + 1;
  }

  if (Object.keys(m).length < k) {
    process.stdout.write("NO\n");
    process.exit(0);
  } else {
    process.stdout.write("YES\n");
    for (const p in m) {
      process.stdout.write(m[p] + " ");
      if (--k <= 0) break;
    }
    process.stdout.write("\n");
    process.exit(0);
  }

});

var g = readline().split(" ");
var y = readline().split(" ");

var k = Number(g[1]);

var out = [];
for(var i =0;i<y.length;i++){
    if(y.indexOf(y[i]) === i){
        out.push(i+1);
    }
}

if(out.length >= k){
    print("YES");
    print(out.slice(0, k).join(" "));
}else
    print("NO");

process.stdin.setEncoding('utf8');

var allinput = "";
process.stdin.on('data', (chunk) => {
  if (chunk !== null) {
    allinput += chunk;
  }
});

process.stdin.on('end', () => {
  allinput.trim();
  allinput = allinput.split(/\s+/);
  let n = parseInt(allinput[0]);
  let k = parseInt(allinput[1]);
  let m = new Map();
  let arr = new Array(n);
  for (let i = 0; i < n; i++) {
    arr[i] = parseInt(allinput[2 + i]);
    m[arr[i]] = i + 1;
  }

  if (Object.keys(m).length < k) {
    process.stdout.write("NO\n");
    process.exit(0);
  } else {
    process.stdout.write("YES\n");
    for (const p in m) {
      process.stdout.write(m[p] + " ");
      if (--k <= 0) break;
    }
    process.stdout.write("\n");
    process.exit(0);
  }

});

  var tmp = readline().split(' ').map(x => parseInt(x));
  var n = tmp[0];
  var k = tmp[1];

  var a = readline().split(' ').map(x => parseInt(x));

  var e = [];
  for(var i = 0; i < n; i += 1) {
    e[a[i]] = 1;
  }
  var res = [];
  for(var i = 0; i <= 100; i += 1) {
    if(e[i] === 1) {
      res.push(a.indexOf(i) + 1);
    }
  }
  if(res.length < k) {
    print('NO');
  } else {
    print('YES');
    print(res.slice(0, k).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 one = nextIntArray()
	var N = one[0];
	var K = one[1];
	var list = nextIntArray();
	var set = new Set();
	var output = [];
	for(var i = 0; i < N; i++){
		if(!set.has(list[i])){
			set.add(list[i]);
			output.push(i + 1);
			if(set.size == K){
				break;
			}
		}
	}
	if(set.size == K){
		myout("YES");
		myout(myconv(output, 8));
	}else{
		myout("NO");
	}
}

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

rl.on('line', (d) => {
  if (c === 0) {
    c++;
    [n, k] = d.split(' ').map(Number);
    return;
  }

  const arr = d.split(' ').map(Number);
  const obj = {};
  const ans = [];

  for (let i = 0; i < arr.length; i++) {
    if (!obj[arr[i]]) {
      ans.push(i + 1);
      obj[arr[i]] = true;
    }
  }

  if (ans.length < k) {
    console.log('NO');
  }
  else {
    console.log('YES');
    console.log(ans.slice(0, k).join(' '));
  }

  c++;
});

process.stdin.setEncoding('utf8');

process.stdin.on('readable', () => {
    let input = process.stdin.read();
    input = input.trim();
    input = input.split('\n');

    main(input);
});

function main(input) {
    let ratings = Array.from(new Set(input[1].split(' ')));
    let final = [];

    for (let i = 0; i < parseInt(input[0].split(' ')[1]); i++) {
        final.push(input[1].split(' ').indexOf(ratings[i]) + 1);
    }

    if (final.includes(0)) {
        console.log('NO');
        process.exit(0);
    }

    console.log(`YES\n${final.join(' ')}`);
    process.exit(0);
}

var found = [];

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

for(var i=0; i<nk[0]; i++) {
	found[numbers[i]]=i+1;
}

var ans = [];
for(var i=1; i<101; i++) {
	if(found[i]) ans.push(found[i]);
}

if(ans.length>=nk[1]) {
	write("YES\n");
	for(var i=0; i<nk[1]; i++) {
		write(""+ans[i]);
		if(i<nk[1]-1) write(" ");
	}
} else {
	write("NO");
}

function main()
{
    var teamSize = readline().split(' ')[1];
	var ratings = readline().split(' ');

	var team = {};
	var selected = [];

	for(var i = 0; i < ratings.length; i++)
	{
		// console.log(team);
		var rating = ratings[i];

		if(!team[rating])
		{
			team[rating] = true;
			selected.push(i+1);
		}

		if(selected.length == teamSize)
		{
			break;
		}
	}

	// console.log(selected.length);
	print(selected.length == teamSize ? "YES" : "NO");
	if(selected.length == teamSize)
	{
		print(selected.join(" "));
	}
    return 0;
}

main();

process.stdin.setEncoding('utf8');

let input = '';

process.stdin.on('data', (chunk) => {
    if (chunk !== null) {
        input += chunk;
    }
});

process.stdin.on('end', () => {
    input.trim();
    input = input.split('\n');

    let ratings = Array.from(new Set(input.slice(2).join(' ').split(' ')));
    let final = [];

    if (ratings.length != input[1]) return console.log('NO');

    ratings.forEach(rating => {
        final.push(input.slice(2).indexOf(rating) + 1);
    });

    console.log(`YES\n${final.join(' ')}`);
    process.exit(0);
})

process.stdin.setEncoding('utf8');

process.stdin.on('readable', () => {
    let input = process.stdin.read();
    input = input.trim();
    input = input.split('\n');

    main(input);
});

function main(input) {
    let ratings = Array.from(new Set(input[1].split(' ')));
    let final = [];

    if (input[0].split(' ')[1] != ratings.length) {
        console.log('NO');
        process.exit(0);
    }

    ratings.forEach(rating => {
        final.push(input[1].split(' ').indexOf(rating) + 1);
    });

    console.log(`YES\n${final.join(' ')}`);
    process.exit(0);
}

process.stdin.setEncoding('utf8');

process.stdin.on('readable', () => {
    let input = process.stdin.read();
    input = input.trim();
    input = input.split('\n');

    main(input);
});

function main(input) {
    let ratings = Array.from(new Set(input[1].split(' ')));
    let final = [];

    for (let i = 0; i < parseInt(input[0].split(' ')[1]); i++) {
        final.push(input.slice(2).indexOf(ratings[i]) + 1);
    }

    if (final.includes(0)) {
        console.log('NO');
        process.exit(0);
    }

    console.log(`YES\n${final.join(' ')}`);
    process.exit(0);
}

process.stdin.setEncoding('utf8');

process.stdin.on('readable', () => {
    let input = process.stdin.read();
    input = input.trim();
    input = input.split('\n');

    main(input);
});

function main(input) {
    let ratings = Array.from(new Set(input[1].split(' ')));
    let final = [];

    if (input[0].split(' ')[1] != ratings.length) return console.log('NO');

    ratings.forEach(rating => {
        final.push(input.slice(2).indexOf(rating) + 1);
    });

    console.log(`YES\n${final.join(' ')}`);
    process.exit(0);
}

process.stdin.setEncoding('utf8');

process.stdin.on('readable', () => {
    let input = process.stdin.read();
    input = input.trim();
    input = input.split(/\s+/);

    main(input);
});

function main(input) {
    let ratings = Array.from(new Set(input[1].split(' ')));
    let final = [];

    if (input[0].split(' ')[1] = ratings.length) {
        console.log('NO');
        process.exit(0);
    }

    ratings.forEach(rating => {
        final.push(input[1].split(' ').indexOf(rating) + 1);
    });

    console.log(`YES\n${final.join(' ')}`);
    process.exit(0);
}

process.stdin.setEncoding('utf8');

process.stdin.on('readable', () => {
    let input = process.stdin.read();
    input = input.trim();
    input = input.split('\n');

    main(input);
});

function main(input) {
    let ratings = Array.from(new Set(input[1].split(' ')));
    let final = [];

    if (input[0].split(' ')[1] != ratings.length || input[0].split(' ')[1] > ratings.length) {
        console.log('NO');
        process.exit(0);
    }

    ratings.forEach(rating => {
        final.push(input[1].split(' ').indexOf(rating) + 1);
    });

    console.log(`YES\n${final.join(' ')}`);
    process.exit(0);
}

process.stdin.setEncoding('utf8');

let input = '';

process.stdin.on('data', (chunk) => {
    if (chunk !== null) {
        input += chunk;
    }
});

process.stdin.on('end', () => {
    input.trim();
    input = input.split('\n');

    let ratings = Array.from(new Set(input.slice(3).join(' ').split(' ')));
    let final = [];

    if (ratings.length != input[2]) return console.log('NO');

    ratings.forEach(rating => {
        final.push(input.slice(3).indexOf(rating) + 1);
    });

    console.log(`YES\n${final.join(' ')}`);
    process.exit(0);
})

process.stdin.setEncoding('utf8');

process.stdin.on('readable', () => {
    let input = process.stdin.read();
    input = input.trim();
    input = input.split('\n');

    main(input);
});

function main(input) {
    let ratings = Array.from(new Set(input[1].split(/\s+/)));
    let final = [];

    if (input[0].split(/\s+/)[1] = ratings.length) {
        console.log('NO');
        process.exit(0);
    }

    ratings.forEach(rating => {
        final.push(input[1].split('/\s+/').indexOf(rating) + 1);
    });

    console.log(`YES\n${final.join(' ')}`);
    process.exit(0);
}

process.stdin.setEncoding('utf8');

var allinput = "";
process.stdin.on('data', (chunk) => {
  if (chunk !== null) {
    allinput += chunk;
  }
});

process.stdin.on('end', () => {
  allinput.trim();
  allinput = allinput.split(/\s+/);
  let n = parseInt(allinput[0]);
  let k = parseInt(allinput[1]);
  let m = new Map();
  let arr = new Array(n);
  for (let i = 0; i < n; i++) {
    arr[i] = parseInt(allinput[2 + i]);
    m[arr[i]] = i + 1;
  }
  if (m.length < k) {
    process.stdout.write("NO\n");
    process.exit(0);
  } else {
    process.stdout.write("YES\n");
    for (const p in m) {
      process.stdout.write(m[p] + " ");
      if (--k <= 0) break;
    }
    process.stdout.write("\n");
    process.exit(0);
  }

});

process.stdin.setEncoding('utf8');

process.stdin.on('readable', () => {
    let input = process.stdin.read();
    input = input.trim();
    input = input.split('\n');

    main(input);
});

function main(input) {
    let ratings = Array.from(new Set(input[1].split(/\s+/)));
    let final = [];

    if (input[0].split(/\s+/)[1] != ratings.length) {
        console.log('NO');
        process.exit(0);
    }

    ratings.forEach(rating => {
        final.push(input[1].split(/\s+/).indexOf(rating) + 1);
    });

    console.log(`YES\n${final.join(' ')}`);
    process.exit(0);
}

function main()
{
    var teamSize = readline().split(' ')[1];
	var ratings = readline().split();

	var team = {};
	var selected = [];

	for(var i = 0; i < ratings.length; i++)
	{
		var rating = ratings[i];
		if(!team[rating])
		{
			team[rating] = true;
			selected.push(i+1);
		}
	}

	print(selected === teamSize ? "YES" : "NO");
	if(selected === teamSize)
	{
		print(selected.join(" "));
	}
    return 0;
}

main();

function main()
{
    var teamSize = readline().split(' ')[1];
	var ratings = readline().split(' ');

	var team = {};
	var selected = [];

	for(var i = 0; i < ratings.length; i++)
	{
		var rating = ratings[i];

		if(!team[rating])
		{
			team[rating] = true;
			selected.push(i+1);
		}
	}

	print(selected.length == teamSize ? "YES" : "NO");
	if(selected.length == teamSize)
	{
		print(selected.join(" "));
	}
    return 0;
}

main();

var g = readline();
var y = readline().split(" ");

var out = [];
for(var i =0;i<y.length;i++){
    if(y.indexOf(y[i]) === i){
        out.push(i+1);
    }
}

if(out.length != 0){
    print("YES");
    print(out.join(" "));
}else
    print("NO");

var g = readline().split(" ");
var y = readline().split(" ");

var k = Number(g[1]);

var out = [];
for(var i =0;i<y.length;i++){
    if(y.indexOf(y[i]) === i){
        out.push(i+1);
    }
}

if(out.length == k){
    print("YES");
    print(out.join(" "));
}else
    print("NO");


var value = readline();
var arr = value.split('+');
var A = arr[0];
var B = arr[1].split('=')[0];
var C = arr[1].split('=')[1];
var aLen = A.length;
var bLen = B.length;
var cLen = C.length;
var end = aLen + bLen - cLen;
if (!(1 <= aLen, bLen, cLen <= 100)) {
  print('Impossible');
}
if (end === 0) {
  print(value);
} else if (end === 2) {
  if (aLen <= 1) {
    print(`${A}+${B.substring(1, bLen)}=${C}|`);
  } else {
    print(`${A.substring(1, aLen)}+${B}=${C}|`);
  }
} else if (end === -2) {
  print(`${A}|+${B}=${C.substring(1, cLen)}`);
} else {
  print('Impossible');
}

function haha(str) {
  const a = str.substring(0, str.indexOf('+'));
  const b = str.substring(str.indexOf('+') + 1, str.indexOf('='));
  const c = str.substring(str.indexOf('=') + 1, str.length);
  const sub = a.length + b.length - c.length;
  if (Math.abs(sub) === 0) return str;
  if (Math.abs(sub) !== 2) return 'Impossible';
  if (sub < 0) return `${a}|+${b}=${c.substr(1, c.length)}`;
  if (a.length > 1) return `${a.substr(1, a.length)}+${b}=${c}|`;
  return `${a}+${b.substr(1, b.length)}=${c}|`;
}

var str = readline();
print(haha(str));

// Save user input
var input = readline();
// Remove spacing characters just in case
input = input.replace(/\s/g, '');
// Define a regular expression to extract the sticks
var sticksRegexp = /(\|+)\+(\|+)=(\|+)/;
// Separate the three numbers using the regexp and transform into actual numbers
var separated = sticksRegexp.exec(input).filter((v, i) => (i)).map((v) => (v.length));
var first = separated[0];
var second = separated[1];
var result = separated[2];
// Declare the sum and difference of the two sides of the expression
var sidesSum = first + second + result;
var sidesDiff = first + second - result;

// Input is correct -> print result
if (!sidesDiff) {
    print(`${'|'.repeat(first)}+${'|'.repeat(second)}=${'|'.repeat(result)}`);
}
else {
    // Sum of sides is odd or difference is not 2 -> print impossible
    if (sidesSum % 2 || Math.abs(sidesDiff) !== 2) {
        print('Impossible');
    }
    else {
        // Result side is bigger
        if (sidesDiff < 0) {
            first++;
            result--;
        }
        else {
            result++;
            // Shifting the bigger of the two numbers to sum to avoid having 0 sticks
            (first > second ? first-- : second--);
        }
        print(`${'|'.repeat(first)}+${'|'.repeat(second)}=${'|'.repeat(result)}`);
    }
}

// Compressed and comment-less version (final)
var separated = /(\|+)\+(\|+)=(\|+)/.exec(readline().replace(/\s/g, '')).filter((v, i) => (i)).map((v) => (v.length));
var sidesDiff = separated[0] + separated[1] - separated[2];
if (Math.abs(sidesDiff) && Math.abs(sidesDiff) !== 2) {
    print('Impossible');
}
else {
    if (sidesDiff !== 0) {
        var tmp = separated[0] + ((sidesDiff < 0 || separated[0] < separated[1]) * 2 - 1) * +(sidesDiff < 0 || separated[0] >= separated[1]);
        separated[1] -= +(sidesDiff > 0 && separated[0] < separated[1]);
        separated[2] += +(sidesDiff > 0) * 2 - 1;
        separated[0] = tmp;
    }
    print(`${'|'.repeat(separated[0])}+${'|'.repeat(separated[1])}=${'|'.repeat(separated[2])}`);
}

function solving(str) {
  const sticks = [str.split("+")[0], ...(str.split("+")[1].split("="))];
  const num = sticks[0].length + sticks[1].length;
  const result = sticks[2].length;
  if(num == result) return str;
  if(num - result === 2){
    if(sticks[0].length !== 1) return `${sticks[0].slice(1)}+${sticks[1]}=${sticks[2]}|`;
    else return `${sticks[0]}+${sticks[1].slice(1)}=${sticks[2]}|`;
  }
  if(num - result === -2) return `${sticks[0]}|+${sticks[1]}=${sticks[2].slice(1)}`;
  return "Impossible";
}

const str = readline();
print(solving(str));

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

rl.on('line', (line) => {
    const data = {
        first: 0,
        second: 0,
        result: 0
    }
    let on = 'first';
    for (let i = 0; i < line.length; i++) {
        if (line[i] == '|') data[on] += 1;
        if (line[i] == '+') on = 'second';
        if (line[i] == '=') on = 'result';
    }
    const {first, second, result} = data;
    if ((first + second) == result) {
        console.log(line);
    } else {
        const my = (first + second) - result;
        if (my == 2) {
            if (first == 1 && second == 1) {
                console.log('Impossible');
            } else {
                let res = 'Impossible';
                if (first >= second) {
                    res = '|'.repeat(first - 1) + '+' + '|'.repeat(second) + '=' + '|'.repeat(result + 1)
                } else if (second >= first) {
                    res = '|'.repeat(first) + '+' + '|'.repeat(second - 1) + '=' + '|'.repeat(result + 1)
                }
                console.log(res)
            }
        } else if (my == -2) {
            if (result == 1) {
                console.log('Impossible');
            } else {
                console.log('|'.repeat(first + 1) + '+' + '|'.repeat(second) + '=' + '|'.repeat(result - 1));
            }
        } else {
            console.log('Impossible');
        }
    }
})

var str = function (x) {
  const a = str.substring(0, str.indexOf('+'));
  const b = str.substring(str.indexOf('+') + 1, str.indexOf('='));
  const c = str.substring(str.indexOf('=') + 1, str.length);
  const sub = a.length + b.length - c.length;
  if (Math.abs(sub) === 0) {
    print(str);
  } else if (Math.abs(sub) !== 2) {
    print('Impossible');
  } else {
    if (sub < 0) return `${a}|+${b}=${c.substr(1, c.length)}`;
    if (a.length > 1) return `${a.substr(1, a.length)}+${b}=${c}|`;
    print(`${a}+${b.substr(1, b.length)}=${c}|`);
  }
};

var str = function (x) {
  const a = str.substring(0, str.indexOf('+'));
  const b = str.substring(str.indexOf('+') + 1, str.indexOf('='));
  const c = str.substring(str.indexOf('=') + 1, str.length);
  const sub = a.length + b.length - c.length;
  if (Math.abs(sub) === 0) {
    print(str);
  } else if (Math.abs(sub) !== 2) {
    print('Impossible');
  } else {
    if (sub < 0) print(`${a}|+${b}=${c.substr(1, c.length)}`);
    if (a.length > 1) print(`${a.substr(1, a.length)}+${b}=${c}|`);
    print(`${a}+${b.substr(1, b.length)}=${c}|`);
  }
};

// Compressed and comment-less version (corrected)
var separated = /(\|+)\+(\|+)=(\|+)/.exec(readline().replace(/\s/g, '')).filter((v, i) => (i)).map((v) => (v.length));
var sidesDiff = separated[0] + separated[1] - separated[2];
if (Math.abs(sidesDiff) && Math.abs(sidesDiff) !== 2) {
    print('Impossible');
}
else {
    if (sidesDiff !== 0) {
        separated[0] += ((sidesDiff < 0 || separated[0] < separated[1]) * 2 - 1) * +(sidesDiff < 0 || separated[0] > separated[1]);
        separated[1] -= +(sidesDiff > 0 && separated[0] < separated[1]);
        separated[2] += +(sidesDiff > 0) * 2 - 1;
    }
    print(`${'|'.repeat(separated[0])}+${'|'.repeat(separated[1])}=${'|'.repeat(separated[2])}`);
}

// Compressed and comment-less version
var separated = /(\|+)\+(\|+)=(\|+)/.exec(readline().replace(/\s/g, '')).filter((v, i) => (i)).map((v) => (v.length));
var sidesDiff = separated[0] + separated[1] - separated[2];
if (Math.abs(sidesDiff) && Math.abs(sidesDiff) !== 2) {
    print('Impossible');
}
else {
    if (sidesDiff !== 0) {
        separated[1] = (separated[0] < separated[1] ? [separated[0], separated[0] = separated[1]][0] : separated[1]);
        separated[0] += +(sidesDiff < 0) * 2 - 1;
        separated[2] += +(sidesDiff > 0) * 2 - 1;
    }
    print(`${'|'.repeat(separated[0])}+${'|'.repeat(separated[1])}=${'|'.repeat(separated[2])}`);
}

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

rl.on('line', (line) => {
    const data = {
        first: 0,
        second: 0,
        result: 0
    }
    let on = 'first';
    for (let i = 0; i < line.length; i++) {
        if (line[i] == '|') data[on] += 1;
        if (line[i] == '+') on = 'second';
        if (line[i] == '=') on = 'result';
    }
    const {first, second, result} = data;
    if ((first + second) == result) {
        console.log(line);
    } else {
        const my = (first + second) - result;
        if (my == 2) {
            if (first == 1 && second == 1) {
                console.log('Impossible');
            } else {
                let res = 'Impossible';
                if (first >= second) {
                    res = '|'.repeat(first - 1) + '+' + '|'.repeat(second) + '=' + '|'.repeat(result + 1)
                } else if (second >= first) {
                    res = '|'.repeat(first) + '+' + '|'.repeat(second - 1) + '=' + '|'.repeat(result + 1)
                }
                console.log(res)
            }
        } else if (my == -2) {
            if (first == 1 && second == 1) {
                console.log('Impossible');
            } else {
                console.log('|'.repeat(first + 1) + '+' + '|'.repeat(second) + '=' + '|'.repeat(result - 1));
            }
        } else {
            console.log('Impossible');
        }
    }
})


;(function () {

    print(function (n, s) {
        var t = s.indexOf('0');

        if (t === -1) return n;
        if (t === 0) return 1;
        return t + 1;
    }(+readline(), readline()));

}.call(this));

var n = +readline(), str = readline().split("");
var cnt = 0;

if(str[0] == "0"){
	write(cnt+1);
}
else{
	for(var i = 0; i < n; i++){
		if(str[i] == "1"){
			cnt++;
		}
		else{
			cnt++;
			break;
		}
	}

	write(cnt);
}

var n = parseInt(readline()),
			bits = readline().split('').map(Number),
			count = 1;

		for(var i = 0; i < n; i++)	{
			if(bits[i] == 1)	{
				count++;
			} else	{
				break;
			}
		}

		if(count == n + 1)	count--;

		//console.log(bits, count);

		print(count);

(function () {
    var n = readline(),
        array = readline(),
        i = 0;
    while (array[i] === "1") i++;
    i++;
    print(i > n ? n : i);
})();

// 465A     inc ARG

var n = parseInt(readline());

// var input_line = readline().split(' ').map(Number);
var input_line = readline();

var count = 0;

for (var i = 0; i < n; i++) {
    if (input_line[i] === '1') {
        count ++;
    } else {
        break;
    }
};

if (count < n) count ++;

print(count);

var n = +readline(), str = readline().split("");
var cnt = 0;

if(str[0] == "0"){
	write(cnt);
}
else{
	cnt++;

	for(var i = 1; i < n; i++){
		if(str[i] == "1"){
			cnt++;
		}
		else{
			cnt++;
			break;
		}
	}

	write(cnt);
}

;(function () {

    print(function (n, s) {
        var t = s.indexOf('0');

        if (t === -1) return n;
        if (t === 0) return 1;
        return n - t + 1;
    }(+readline(), readline()));

}.call(this));

;(function () {

    print(function (n, s) {
        var t = s.indexOf('0');

        if (t === -1) return n;
        return n - t + 1;
    }(+readline(), readline()));

}.call(this));

var n = parseInt(readline()),
			bits = readline().split('').map(Number),
			count = 0, flag = false;

		bits = bits.reverse();

		for(var i = n - 1; i >= 0; i--)	{
			if(bits[i] + 1 == 2 && !flag)	{
				bits[i] = 0;

				count++;
			} else if(!flag)	{
				bits[i] = 1;
				flag = true;
			} else	{
				count++;
			}
		}

		print(count);

var n = parseInt(readline()),
			bits = readline().split('').map(Number),
			count = 0, flag = false;

		bits = bits.reverse();

		for(var i = n - 1; i >= 0; i--)	{
			if(bits[i] + 1 == 2 && !flag)	{
				bits[i] = 0;

				count++;
			} else if(!flag)	{
				bits[i] = 1;
				flag = true;
			} else if(flag && bits[i] == 0)	{
				count++;
			}
		}

		//console.log(bits);

		print(count);