jiahuimbzuai/CoQuIR huggingface dataset:
//  [java]
import java.util.*;
import java.math.*;
import java.io.*;
import java.text.*;
class Main {
    static class Node implements Comparable<Node>{
        int id;
        int p;
        int t;
        public Node(int id,int p,int t){
            this.p=p;
            this.t=t;
            this.id=id;
        }
        public int compareTo(Node c){
            return this.p-c.p;
        }
    }
    //public static PrintWriter pw;
    public static PrintWriter pw = new PrintWriter(System.out);

    public static void solve() throws IOException {
//	pw=new PrintWriter(new FileWriter("C:\\Users\\shree\\Downloads\\small_output_in"));
        FastReader sc = new FastReader();
        char s[]=sc.next().toCharArray();
        for(int i=0;i<s.length;i++){
            if(s[i]=='9'){
                pw.println("Yes");
                pw.close();
                return;
            }
        }
        pw.println("No");




        pw.close();

    }


    public static void main(String[] args) {
        new Thread(null, new Runnable() {
            public void run() {
                try {

                    solve();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }, "1", 1 << 26).start();

    }

    static BufferedReader br;
    static long M = (long) 1e9 + 7;

    static class FastReader {

        StringTokenizer st;

        public FastReader() throws FileNotFoundException {
            //br=new BufferedReader(new FileReader("C:\\Users\\shree\\Downloads\\B-small-practice.in"));
            br = new BufferedReader(new InputStreamReader(System.in));

        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int I() {
            return Integer.parseInt(next());
        }

        long L() {
            return Long.parseLong(next());
        }

        double D() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public boolean hasNext() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                String s = br.readLine();
                if (s == null) {
                    return false;
                }
                st = new StringTokenizer(s);
            }
            return true;
        }

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

public class Main {
    private static Scanner sc;

    public Main() {
    }

    public static void main(String[] args) {
        sc = new Scanner(System.in);
        new Main().solve();

    }

    private void solve() {
        String N = sc.next();
        String ans = "No";
        for (int i = 0; i < 2; i++) {
            if (N.charAt(i) == '9') {
                ans = "Yes";
            }
        }
        
        System.out.println(ans);
    }
}
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        if(n / 10 == 9 || n % 10 == 9){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;cin>>n;
    while(n>0){
        if(n%10==9){
            cout<<"Yes\n";
            return 0;
        }
        n/=10;
    }
    cout<<"No\n";
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  if (n % 10 == 9 || n / 10 == 9) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}
//  [cpp]
//Sinhov : "Hi stalker!"
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <iomanip>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define mod 1000000007
int main() {
    ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
    string s;
    ll i;
    cin>>s;
    for(i=0;i<s.length();i++){
        if(s[i]=='9'){
            cout<<"Yes";
            return 0;
        }
    }
    cout<<"No";
    return 0;
}
//  [c]
#include<stdio.h>
int main ()
{
    int N;
    scanf("%d",&N);
    if(N==19 ||N==29 ||N==39 ||N==49 ||N==59 ||N==69 ||N==79 || N>88)
    printf("Yes");
    else printf("No");
    return 0;
}
//  [c]
#include<stdio.h>
int main(){
int N,x,y;
scanf("%d",&N);
if(N>=10 && N<=99){
x= N/10;
y=N%10;
if(x==9 || y==9){
    printf("Yes\n");
}
else{
    printf("No\n");
}
}
return 0;
}
//  [c]
#include<stdio.h>
#include<stdbool.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#define rep(i,n) for(int i=0; i <(n); i++)

int compint(const void *a,const void *b){
  return *(int *)a-*(int *)b;
}
int main(){
  char s[3];
  scanf("%s",s);
  int len=strlen(s);
  rep(i,len){
    if(s[i]=='9'){
      printf("Yes\n");
      return 0;
    }
  }
  printf("No\n");
  return 0;
}
//  [javascript]
function Main(input){
	var n = input;
	if(Math.floor(n / 10) === 9 || n % 10 === 9){
		console.log("Yes");
	}else{
		console.log("No");
	}
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var g_input = '';
process.stdin.on('data', function(chunk) {
    g_input += chunk;
});

process.stdin.on('end', function() {
    Main(g_input.split(/\r?\n/));
});

function Main(input) {

    if (input[0][0] === '9' || input[0][1] === '9') {
        console.log('Yes');
    }
    else {
        console.log('No');
    }

    return 0;
}
//  [javascript]
function Main(input) {
  var a = input.split('').map(n => parseInt(n, 10));
    if(a[0]==9 || a[1]==9) {
      console.log('Yes');

    } else {
      console.log('No');
    }
 }
  Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
package main

import "fmt"

func main() {
	// Code for A - September 9
	var N string
	fmt.Scanf("%s", &N)

	if N[0] == '9' || N[1] == '9' {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}
//  [go]
package main

import (
	"fmt"
	"strconv"
)

func main() {
	var n int
	fmt.Scan(&n)

	s := strconv.Itoa(n)

	for _, v := range s {
		if v == '9' {
			fmt.Println("Yes")
			return
		}
	}
	fmt.Println("No")
}
//  [ruby]
puts`dd`[/9/]?:Yes: :No
//  [ruby]
puts gets.include?("9") ? :Yes: :No
//  [ruby]
s = gets().chomp.to_s.split('').map{|x| x.to_i}

puts s.include?(9) ? 'Yes' : 'No'
//  [rust]
#![allow(unused_imports)]

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

fn main() {
    input! {
    a:String,
    }
    let a=a.chars().collect_vec();
    println!("{}",if a[0]=='9'||a[1]=='9'{"Yes"}else{"No"})
}
//  [rust]
macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let n = get!(String).chars().collect::<Vec<_>>();
    println!("{}", if n[0] == '9' || n[1] == '9' { "Yes" } else { "No" });
}
//  [typescript]
import { readFileSync } from "fs";

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

const main = (input: string[][]) => {
  const N = input[0][0];

  return N.includes("9") ? "Yes" : "No";
};

console.log(main(read()));
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const n = stdin.split('\n')[0].split('')

console.log(n.indexOf('9') > -1 ? 'Yes' : 'No')
//  [python]
x,y = map(int,input().split())
if x%y==0:
	print('-1')
else:
	print(x)
//  [python]
x,y = [int(x) for x in input().split()]

ans = x
if ans % y  == 0: ans += y

print(-1 if ans % y == 0 or ans > 1e18 else ans)
//  [python]
def gcd(a, b):
	if (b == 0): return a
	return gcd(b, a % b)

x, y = map(int, input().split())
d = gcd(x, y)
a = x // d
b = y // d

if (b == 1):
	print(-1)
else:
	print (a * (b - 1) * d)
//  [python]
x, y = map(int, input().split())

if x == y:
  print(-1)
  exit()

if y == 1:
  print(-1)
  exit()

for i in range(1, y):
  temp = x * i
  if temp <= 10 ** 18 and temp % y != 0:
    print(x*i)
    exit()

print(-1)
//  [python]
X, Y = map(int, input().split())
ans = -1
for i in range(10**8):
  Z = X*(i+2)
  if Z%Y != 0 and Z <= 10**18:
    ans = Z
    break
  if Z > 10**18:
    break
print(ans)
//  [python]
x,y=map(int,input().split())
if x%y==0:
  print(-1)
else:
  print(x)
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main
{

  public static void main
  (
    String[] args
  )
  {
    BufferedReader in_stream;
    String         in_str;
    String[]       in_str_split;

    int in_X;
    int in_Y;

    long cnt;
    long ans;

    try
    {
      in_stream = new BufferedReader(new InputStreamReader(System.in));

      in_str       = new String(in_stream.readLine());
      in_str_split = in_str.split(" ");

      in_X = Integer.parseInt(in_str_split[0]);
      in_Y = Integer.parseInt(in_str_split[1]);


      if(0 == (in_X % in_Y))
      {
        ans = -1;
      }
      else
      {
        ans = -1;
        for(cnt = (in_X*2); cnt<1000000000000000000L; cnt+=in_X)
        {
          if(0 != (cnt % in_Y))
          {
            ans = cnt;
            break;
          }
        }
      }


      UtilLog.ans_ln("" + ans);
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
  }
}

class UtilLog
{
  private static boolean is_debug_mode = false;



  public static void ans_ln
  (
    String i_message
  )
  {
    System.out.println(i_message);
  }



  public static void ans_f
  (
    String i_message
  )
  {
    System.out.printf(i_message);
  }



  public static void inf_ln
  (
    String i_message
  )
  {
    StackTraceElement[] stack;


    if(is_debug_mode)
    {
    stack = new Throwable().getStackTrace();

    System.out.println
      (
        String.format
          (
            "[inf][%s:%s():%5d]",
            stack[1].getClassName(),
            stack[1].getMethodName(),
            stack[1].getLineNumber(),
            i_message
          )
      );
    }
  }
}
//  [java]
import java.util.*;

class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);

        long x = sc.nextLong();
        long y = sc.nextLong();

        long a = x * y;

        for (long i = x; i <= a; i += x) {
            if (x % y != 0) {
                System.out.println(x);
                return;
            }
        }

        System.out.println(-1);
    }
}
//  [java]
import java.util.Scanner;

public class Main {
  static Scanner sc = new Scanner(System.in);

  public static void main(String[] args) {
    int X = sc.nextInt();
    int Y = sc.nextInt();
    System.out.println(X % Y == 0 ? -1 : X);
  }

}
//  [cpp]
#include<cstdio>

#define Max 1000000000000000000ll
#define LL long long
#define Fast register
char BUF[30],*S=BUF;
inline LL Getint(){
	Fast LL s=0;Fast char c;
	while(c=*S++,c<48||c>57);
	while(s=s*10+c-48,c=*S++,c>47&&c<58);
	return s;
}

inline LL gcd(const LL&x,const LL&y){return!y?x:gcd(y,x%y);}

int main(){
	fread(BUF,1,30,stdin);
	Fast LL x=Getint(),y=Getint();
//	if(gcd(x,y)==y||x*gcd(x,y)>Max)return(puts("-1"),0);
//	return(printf("%lld",x*gcd(x,y)),0);
	if(gcd(x,y)==y)return(puts("-1"),0);
	Fast LL Ans=x;
	while(true){
		if(Ans>Max)return(puts("-1"),0);
		if(Ans%y)return(printf("%lld",Ans),0);
		Ans+=x;
	}
}
//  [cpp]
#include<cstdio>
inline void scan(int &num){
int c=getchar();
num=0;
while(c<'0'||c>'9')c=getchar();
while(c>='0'&&c<='9'){num=num*10+c-'0';c=getchar();}
}
int main(){
int x,y;
long long  i=2;
long long result;
long long max=1000000000000000000;
long long imax;
scan(x);
scan(y);
imax=max/x;
if(x%y==0){printf("-1\n");return 0;}
for(i=1;i<y&&(y+i)<imax;i++){
result=x*(y-i);
if((result%y)){printf("%lld\n",result);return 0;}
result=x*(y+i);
if((result%y)){printf("%lld\n",result);return 0;}
}
for (i=y;i<imax;i++){
result=i*x;
if((result%y)){printf("%lld\n",result);return 0;}
}
printf("-1");
return 0;
}
//  [cpp]
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;

int main(void){
	int X,Y;
	cin>>X>>Y;
	if(X%Y==0){
		printf("-1\n");
	}else{
		printf("%d\n",X);
	}
	return 0;
}
//  [cpp]
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long LL;
LL n;
int x, y;
int main()
{
	scanf("%d %d",&x,&y);
	int flag = 0;
	for(int i = 1;i <= 100000000;i++)
	{
		n = i * x;
		if(n % x == 0 && n % y != 0)
		{
			printf("%d\n",n);
			flag = 1;
			return 0;
		}
	}
	if(flag == 0)
	{
		printf("-1\n");
	}
	return 0;
}
//  [cpp]
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <iostream>
#include <algorithm>
#include <queue>
#include <map>

using namespace std;

typedef long long ll;
const int Maxn = 1e9 + 10;
const int N = 1e5 + 10;
const int INF=(0x7fffffff)/2;

int main(){
    ll x,y;
    while(~scanf("%lld %lld",&x, &y)){
    	ll n = 0;
		for(ll i = 1; i <= 1e8; i++){
			ll c = i * x;
			if(c % y != 0){
				n = c;
				break;
			}
		}
		if(n == 0)
			printf("-1\n");
		else
			printf("%lld\n", n);
	}
}
//  [c]
#include<stdio.h>
typedef long long ll;
int main(void)
{
  ll x,y;
  scanf("%lld %lld",&x,&y);
  if(x%y==0){
    puts("-1");
    return 0;
  }
  printf("%lld\n",x);
  return 0;
}
//  [c]
#include <stdio.h>

int main (void)
{
    long X,Y;
    scanf("%ld %ld",&X,&Y);
    if(X>=Y&&X%Y==0)
    {
        puts("-1");
        return 0;
    }
    for(long i=1;i<Y;i++)
    {
        if(X*i%Y!=0)
        {
            printf("%ld",X*i);
            break;
        }
    }
    return 0;
}
//  [c]
#include <stdio.h>
typedef long long ll;
int main() {
	int x, y;
	scanf("%d%d", &x, &y);
	if (x % y == 0) {
		printf("-1\n");
	} else {
		printf("%lld\n", (ll)x * (y - 1));
	}
	return 0;
}
//  [c]
#include<stdio.h>
#define N 1000000000000000000

int main(void)
{
  int X,Y;

  scanf("%d",&X);
  scanf("%d",&Y);

  if(X % Y != 0){
    for( int i = 0 ; i <= N ; i++ ){
      if((i % Y != 0)&&(i >= X)&&(i >= Y)){
        if(i % X == 0){
          printf("%d",i);
          break;
        }
      }
    }
  }
  else{
    printf("%d",-1);
  }

  return 0;

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

int main()
{
  long long int X,Y;

  scanf("%lld %lld",&X,&Y);

  printf("%lld\n",X%Y ? X : -1);

  return 0;
}
//  [javascript]
function Main(input) {
  input = input.split("\n");
  var x = parseInt(input[0].split(" ")[0]);
  var y = parseInt(input[0].split(" ")[1]);
  var ans = -1;
  if(x%y!=0){
    ans=x;
  }
  console.log('%s', ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    tmp = input.split(" ");
    var a = parseInt(tmp[0], 10);
    var b = parseInt(tmp[1], 10);
    if(a%b === 0){console.log(-1);return;}else{console.log(a);}
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    tmp = input.split(" ");
    //文字列から10進数に変換するときはparseIntを使います
    var a = parseInt(tmp[0], 10);
    var b = parseInt(tmp[1], 10);
    //出力
    if(a%b === 0){
        console.log(-1);
        return;
    }else{
        console.log(a);
    }
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
const Debug = function () {
    const stdin = function (text) {
        return '123 6';

    };

    return stdin;
};


const Release = function () {
    const fs = require('fs');
    const stdin = function (text) {
        if (text) console.log(text);
        return fs.readFileSync('/dev/stdin', 'utf8');
    }
    return stdin;
};


const debug = false;

const stdin = debug ? Debug() : Release();
const input = stdin().split(' ').map(x => parseInt(x));

const X = input[0];
const Y = input[1];

const primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29];//, 31, 37];//, 41, 43, 47];
if (X % Y === 0) console.log(-1);
else {
    var h = true;
    for (var i = 0; i < primes.length; i++) {
        var x = X * primes[i];
        if (x > 1000000000000000000) {
            console.log(-1);
            h = false;
            break;
        } else {
            if (x % Y !== 0) {
                console.log(x);
                h = false;
                break;
            }
        }
    }
    if (h) console.log(-1);
}
//  [javascript]
"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
   let X = xs[0];
   let Y = xs[1];
   let ans = 0;
     if(X%Y==0){
       ans = -1;
     }else{
       ans = X;
     }
    console.log(ans);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [javascript]
function Main(input) {
	input = input.trim().split(" ").map((a)=>Number(a));
  var A = input[0];
  var B = input[1];
  if(A % B != 0){
     console.log(A);
  }else{
   	console.log(-1); 
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
// ProblemURL : https://atcoder.jp/contests/apc001/tasks/apc001_a
// ---------------------------------------------
package main

import "fmt"

func main() {
	var x, y int
	fmt.Scan(&x, &y)

	if x%y == 0 {
		fmt.Println(-1)
	} else {
		fmt.Println(x)
	}
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

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

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func main() {
	sc.Split(bufio.ScanWords)
	x, y := nextInt(), nextInt()
	if x%y == 0 {
		fmt.Println(-1)
		return
	}
	fmt.Println(x)
}
//  [go]
package main

import "fmt"

const max = 1e18

func main() {
	var x, y int
	fmt.Scan(&x, &y)

	if x%y == 0 {
		fmt.Println(-1)
		return
	}
	fmt.Println(x)
}
//  [go]
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getInts(N int) []int {
	ret := make([]int, N)
	for i := 0; i < N; i++ {
		ret[i] = getInt()
	}
	return ret
}

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

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

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

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

// GCD : greatest common divisor (GCD) via Euclidean algorithm
func GCD(a, b int) int {
	for b != 0 {
		t := b
		b = a % b
		a = t
	}
	return a
}

// LCM : find Least Common Multiple (LCM) via GCD
func LCM(a, b int, integers ...int) int {
	result := a / GCD(a, b) * b

	for i := 0; i < len(integers); i++ {
		result = LCM(result, integers[i])
	}

	return result
}

// PfsMap : 素因数分解し、マップを作成
func PfsMap(n int) map[int]int {
	pfs := make(map[int]int)
	for n%2 == 0 {
		pfs[2] = pfs[2] + 1
		n = n / 2
	}

	for i := 3; i*i <= n; i = i + 2 {
		for n%i == 0 {
			pfs[i] = pfs[i] + 1
			n = n / i
		}
	}

	if n > 2 {
		pfs[n] = pfs[n] + 1
	}

	return pfs
}

func main() {
	sc.Split(bufio.ScanWords)
	x, y := getInt(), getInt()

	if x%y == 0 {
		out(-1)
		return
	}

	out(x)
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var x, y int
	fmt.Scan(&x, &y)
  
	if x % y == 0 {
      fmt.Println(-1)
      return
	}
	fmt.Println(x)
}
//  [ruby]
#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
    return Array.new(size1){init}
  else
    return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY

X,Y=get_i
if X.gcd(Y)==Y
    puts -1
else
    puts X*(Y+1)
end
//  [ruby]
x, y = gets.chomp.split.map(&:to_i)
res = x * (y - 1)
puts (res > 10 ** 18 || x % y == 0)? "-1" : res
//  [ruby]
a,b=gets.strip.split.map(&:to_i)
if a%b==0
  puts -1
  exit
end
puts a
//  [ruby]
x, y = gets.chomp.split(' ').map(&:to_i)
if x < y
  puts x
elsif (x % y).zero?
  puts '-1'
else
  puts x
end
//  [ruby]
x, y = gets.chomp.split(' ').map(&:to_i)
if (x % y).zero?
  puts '-1'
else
  puts x
end
//  [ruby]
def run(x, y)
  if x == y
    -1
  elsif x.modulo(y) == 0
    -1
  else
    x.lcm(y) + x
  end
end

x, y = gets.chomp.split.map(&:to_i)
puts run(x, y)
//  [rust]
use proconio::input;

fn main() {
    input! {
        x: usize,
        y: usize,
    };
    if x % y == 0 {
        println!("-1");
        return;
    }
    for n in (x + x..).step_by(x) {
        if n % y != 0 {
            println!("{}", n);
            return;
        }
    }
}
//  [rust]
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let line = read_as_vec::<u64>();
    let (x, y) = (line[0], line[1]);

    if x%y == 0{
        println!("-1");
        return;
    }
    let mut ans = x;
    while ans <= 1_000_000_000_000_000_000{
        if ans%y > 0{
            println!("{}", ans);
            return;
        }
        ans += x;
    }
    println!("-1");
}
//  [rust]
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::string::*;
#[allow(unused_imports)]
use std::collections::*;

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

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

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

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

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

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

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

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

// fn gcd (x : i32, y : i32) -> i32 {
//     let mut a = x;
//     let mut b = y;
//     while(a > 0){
        

//     }
// }


fn main() {

input! {
    x: i32,
    y: i32,
}
let ans = if x%y==0 {-1} else {x};
println!("{}",ans);


}
//  [rust]
use proconio::input;

fn main() {
    input! {
        x: usize,
        y: usize,
    };
    if x == y {
        println!("-1");
        return;
    }
    if x % y == 0 {
        println!("-1");
        return;
    }
    for n in (x + x..).step_by(x) {
        if n % y != 0 {
            println!("{}", n);
            return;
        }
    }
}
//  [rust]
use proconio::{input,fastout};

#[fastout]
fn main() {
  input! {
    n: isize,
    m: isize,
  }
  let ans = if n % m == 0 {
    -1
  } else {
    n
  };
  
  println!("{}",ans);
}
//  [swift]
let i=readLine()!.characters.split(" ").map{Int(String($0))!},X=i[0],Y=i[1]
print(X%Y>0 ?X:-1)
//  [typescript]
function main(input) {
  const [x, y] = input.split(" ").map(n => Number(n));
  let result = x;
  if (x%y === 0) {
    result = -1;
  }
  console.log(result);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
import numpy as np

a, b, k = list(map(int, input().split(" ")))

if((b - a + 1) / 2 < k):
    for i in range(a, b+1, 1):
        print(i)
else:
    for i in range(a, a+k, 1):
        print(i)
    for i in range(b-k+1, b+1, 1):
        print(i)
//  [python]
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
A, B, K = ri_()
a = [i for i in range(A, B + 1) if i <= A + K - 1 or i >= B - K + 1]
for ai in a:
    print(ai)
//  [python]
A,B,K = map(int,input().split())

for i in range(A,B+1,1):
    if i-A < K or B-i < K:
        print(i)
//  [java]
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int K = sc.nextInt();
		for (int i = A; i <= B; i++) {
			if (B-A-1>=K &&(i >= A && A + K > i) || (B >= i && i > B - K)) {
				System.out.println(i);
			}else if(K>B-A-1) {
				System.out.println(i);
			}
		}
	}
}
//  [java]
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int A = reader.nextInt();
		int B = reader.nextInt();
		int K = reader.nextInt();
		for (int i = A; i <= B; i++) {
			if ((Math.abs(A - i) < K) || (Math.abs(B - i) < K)) {
				System.out.println(i);
			}
		}
		reader.close();
	}
}
//  [java]
import java.util.*;
 
public class Main {
 	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int K = sc.nextInt();

		for(int i=A; i<=B; i++){
			if(isRange(i, A, A+K-1)==true){
				System.out.println(i);
			}else if(isRange(i, B-K+1, B)==true){
				System.out.println(i);
			}
		}
	}

	public static boolean isRange(int x, int from, int to){
		return (x>=from && x<=to);
	}
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;

int main()
{
	int a, b, k; cin >> a >> b >> k;
	
	vector<int> c;

	for (int i = a; i <= b; i++) {

		if (i - a + 1 <= k  || b - i + 1 <= k) c.push_back(i);

	}

	sort(c.begin(), c.end());

	for (int i = 0; i < c.size(); i++) cout << c[i] << endl;

	return 0;
}
//  [cpp]
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
	int a, b, k;
	cin >> a >> b >> k;
	vector<bool> ans(b + 1);
	for (int i = a; i <= b; i++) {
		if (i < a + k || i > b - k)
			ans[i] = true;
	}
	for (int i = a; i <= b; i++) 
		if (ans[i])	cout << i << endl;
	
	return 0;
}
//  [cpp]
// https://atcoder.jp/contests/abc093/tasks/abc093_b

#include <bits/stdc++.h>
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define REPR(i, n) for (int(i) = (n); (i) >= 0; (i)--)
#define FOR(i, m, n) for (int(i) = (m); (i) < (n); i++)
#define INF 1e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;

int main()
{
  /* Magic word */
  // cin.tie(0);
  // ios::sync_with_stdio(false);
  /* ---------- */

  int a, b, k;
  vector<int> r;

  cin >> a >> b >> k;

  FOR(i, a, b + 1)
  {
    if (i - a < k || b - i < k)
      r.push_back(i);
  }

  REP(i, r.size())
  {
    cout << r[i] << '\n';
  }

  return 0;
}
//  [c]
i;main(a,b,k){scanf("%d%d%d",&a,&b,&k);for(i=a;i<=b;i++)if(i<a+k||i>b-k)printf("%d\n",i);}
//  [c]
i;main(a,b,k){for(scanf("%d%d%d",&a,&b,&k),i=a;i<=b;i++)i-a<k|i>b-k&&printf("%d ",i);}
//  [c]
#include<stdio.h>
int main(){
  int a,b,c;
  scanf("%d %d %d",&a,&b,&c);
  for(int i=a; i<=b; i++){
    if(i<a+c||b-c<i){printf("%d\n",i);}
  }
  return 0;}
//  [javascript]
const main = stdin => {
  const input = stdin.trim().split('\n')
  const [A, B, K] = input[0].split(' ').map(x => parseInt(x))

  for (let i = A; i <= B; i++) {
    if (i < A + K || i > B - K) {
      console.log(i);
    }
  }
}


// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
//  [javascript]
function Main(input){
	input=input.split(/\n|\s/);
	input.forEach(function(e,i,a){a[i]=Number(a[i]);});
	for(var i=input[0];i<input[0]+input[2]&&i<=input[1];i=(i+1)|0){
		console.log(i);
	}
	for(var j=(1+input[1]-input[2])<i?i:(1+input[1]-input[2]);j<=input[1];j=(j+1)|0){
		console.log(j);
	}
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict'

const main = (input) => {
    input = input.split(' ').map(i => parseInt(i))
    const A = input[0]
    const B = input[1]
    const K = input[2]

    let nums = new Set()
    for(let i = A; i <= Math.min(A + K - 1, B); i++){
        nums.add(i)
    }
    for(let i = Math.max(B - K + 1, A + K); i <= B; i++){
        nums.add(i)
    }
    nums.forEach(v => console.log(v))
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))
//  [go]
package main

import (
	"fmt"
)

func main() {
	var A, B, K int
	fmt.Scan(&A, &B, &K)
	cnt := 0
	for i := A; i <= B; i++ {
		b := false
		if cnt < K {
			fmt.Println(i)
			b = true
		}
		if B-(A+cnt) < K && !b {
			fmt.Println(i)
		}
		cnt++
	}
}
//  [go]
package main
import(
  "fmt"
)
func main(){
  var a, b, k, i int
  fmt.Scan(&a, &b, &k)
  for i=a;i<=b;i++{
    if i<a+k{
      fmt.Println(i)
    }else if i>b-k{
      fmt.Println(i)
    }
  }
}
//  [go]
package main

import "fmt"

func main() {
	// Code for B - Small and Large Integers
	var A, B, K int
	fmt.Scanf("%d %d %d", &A, &B, &K)

	for i := A; i <= B; i++ {
		if i < A+K || B-K < i {
			fmt.Println(i)
		}
	}
}
//  [ruby]
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

A, B, K = get_ints

set = SortedSet.new

A.step(B).with_index do |x, i|
  break if i >= K
  set.add(x)
end

B.step(A, -1).with_index do |x, i|
  break if i >= K
  set.add(x)
end

set.to_a.each do |a|
  puts a
end
//  [ruby]
a, b , k = gets.chomp.split(" ").map(&:to_i)
ar = [*a..a+k-1]
ab = []
ar.each do |i|
    if i >= a && i <= b
        ab << i
    end
end
br = [*b-k+1..b]
ba = []
br.each do |j|
    if j >= a && j <= b
        ba << j
    end
end
arr = ab + ba
arr = arr.uniq
arr.each do |i|
    puts i
end
//  [ruby]
a,b,k = gets.split.map(&:to_i)
i=[b,a+k-1].min
j=[a,(b-k+1)].max
x=[*a..i]|[*j..b]
x.each{|z|puts z}
//  [rust]
fn main() {
    let a: i32 = read();
    let b: i32 = read();
    let k: i32 = read();

    for i in a..b+1 {
        if (a <= i && i <= a+k-1) || (b-k+1 <= i && i <= b) {
            println!("{}", i);
        }
    }
}

// 以下関数

use std::io::*;
use std::str::FromStr;
pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

pub const MOD: u64 = 1_000_000_007;

pub fn is_prime(n: i32) -> bool {
    if n < 2 {
        return false;
    } else if n == 2 {
        return true;
    }
    let mut i = 2;
    while i * i < n {
        if n % i == 0 {
            return false;
        } else {
            i += 1;
            continue;
        }
    }
    true
}

pub fn lcm(mut n: i32, mut m: i32) -> i32 {
    n = if n > m { m } else { n };
    m = if n > m { n } else { m };
    let mut i = n;
    while i % m != 0 {
        i += n;
    }
    i
}

pub fn abs(n: i32) -> i32 {
    if n >= 0 {
        n
    } else {
        -n
    }
}

pub fn max(n: i32, m: i32) -> i32 {
    if n >= m {
        n
    } else {
        m
    }
}

pub fn min(n: i32, m: i32) -> i32 {
    if n <= m {
        n
    } else {
        m
    }
}

pub fn factorial(n: u32) -> u32 {
    if n == 0 {
        return 1;
    }
    let mut r = n;
    for i in 0..n - 1 {
        r *= n - i - 1;
    }
    r
}

pub fn combination(n: u32, m: u32) -> u32 {
    factorial(n) / factorial(m) / factorial(n - m)
}
//  [rust]
use std::io::*;
use std::str::*;

fn read<T: FromStr>(s: &mut StdinLock) -> Option<T> {
    let s = s.by_ref()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok()
}

fn main() {
    let s = stdin();
    let mut s = s.lock();
    let a: i32 = read(&mut s).unwrap();
    let b: i32 = read(&mut s).unwrap();
    let k: i32 = read(&mut s).unwrap();
    for i in a..(b + 1) {
        if (i - a + 1) <= k || (b - i + 1) <= k {
            println!("{}", i);
        }
    }
}
//  [rust]

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

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

fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
fn main(){
    let input = read_vec::<i64>();
    for x in input[0]..input[1]+1 {
        if x <  input[0]+input[2] || x > input[1] - input[2] {
            println!("{}",x);
        }
    }
}
//  [typescript]
var lines: string[] = [];
var reader: any = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on("line", function(line: string) {
  lines.push(line);
});

reader.on("close", function() {
  // A B K
  var numbers: number[] = lines[0].split(" ").map(x => {
    return Number(x);
  });
  var numA: number = numbers[0];
  var numB: number = numbers[1];
  var numK: number = numbers[2];
  var maxNumInFirst: number = 0;
  for (var i: number = numA; i < numA + numK && i <= numB; i++) {
    console.log(i);
    maxNumInFirst = i;
  }
  for (var i: number = numB - numK + 1; i < numB + 1; i++) {
    if (maxNumInFirst < i) {
      console.log(i);
    }
  }
});
//  [typescript]
"use strict"
let fs = require('fs');
let input = fs.readFileSync("/dev/stdin", "utf8").split(/\s/);

const A = +input[0], B = +input[1], K = +input[2];
let ans: number[] = [];
for(let i=A; i < A+K && i <= B; i++) ans.push(i);
for(let i=B; i > B - K && i >= A; i--) ans.push(i);
ans.sort((a,b) => a - b);
ans = Array.from(new Set(ans));
ans.forEach((val) => console.log(val));
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8').trim()

const [a, b, k] = stdin
  .split('\n')[0]
  .split(' ')
  .map(Number)

const ans = () => {
  let right = a
  for (let i = 0; i < k && right <= b; i++, right++) {
    console.log(right)

    if (right >= b) {
      return
    }
  }

  let left = b
  let lefts = []
  for (let i = 0; i < k && right - 1 < left; i++, left--) {
    lefts.push(left)
  }

  lefts.reverse().forEach(v => console.log(v))
}

ans()
//  [python]
from sys import stdin
import numpy as np

S = stdin.readline().rstrip().split()[0]

Frag = False
if S[0]==S[1]:
    Frag=True
elif S[1]==S[2]:
    Frag=True
elif S[2]==S[3]:
    Frag=True
if Frag:
    print("Bad")
else:
    print("Good")
//  [python]
import numpy as np
S = input()

flag = 0
for i in range(0, len(S)-1):
  if S[i] == S[i+1]:
    flag = 1
    break

if flag == 0:
  print("Good")
else:
  print("Bad")
//  [python]
import numpy as np
import math
import sys
sys.setrecursionlimit(10000000)

def main():
    S = input()
    for i in range(3):
        if S[i] == S[i + 1]:
            print("Bad")
            break
    else:
        print("Good")

if __name__ == '__main__':
    main()
//  [java]
import java.util.Scanner; 
import java.util.stream.Stream;

public class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str  = sc.nextLine();
        String[] astr = str.split("");
        Boolean flag  = true;
        int[] in_data = Stream.of(astr).mapToInt(x->{
            try{
                return Integer.parseInt(x);
            }
            catch(Exception e){
                e.printStackTrace();
            }
            return 0;
        }).toArray();
        sc.close();

        for(int i=1;i<in_data.length;i++){
            flag = check(in_data[i-1], in_data[i]);
            if(flag == false){
                System.out.println("Bad");
                System.exit(0);
            }
        }
        if(flag == true){
            System.out.println("Good");
        }
    }

    public static Boolean check(Integer a, Integer b){
        if(a == b){
            return false;
        }
        else{
            return true;
        }
    }
}
//  [java]

// 問題URL
// https://atcoder.jp/contests/abc131/tasks/abc131_a

import java.util.Scanner;
import java.util.Arrays;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        String[] ar = str.split("");
        int[] iar = Stream.of(ar).mapToInt(Integer::parseInt).toArray();

        boolean flag = false;
        for(int i =0; i < 4; i++) {
            for(int j =i; j < iar.length; j++) {
                if ( i == j) continue;
                if(iar[i] == iar[j]) {
                    flag = true;
                }
                break;
            }
        }
        if(flag) {
            System.out.println("Bad");
        }else {
            System.out.println("Good");
        }
    }
}
//  [java]
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.function.Consumer;

public class Main {
    private static final Scanner scanner = new Scanner(System.in);
    private static final Consumer<List<String>> consumer = solve();

    public static void main(String[] args) {
        consumer.accept(readInput());
    }

    private static List<String> readInput() {
        final List<String> lineList = new ArrayList<>();
        while (scanner.hasNextLine()) {
            lineList.add(scanner.nextLine());
        }
        return lineList;
    }

    private static Consumer<List<String>> solve() {
        return args -> {
            boolean ans = false;
            for (int i = 0; i < 3; i++) {
                ans |= args.get(0).charAt(i) == args.get(0).charAt(i + 1);
            }
            System.out.println(ans ? "Bad" : "Good");
        };
    }

}
//  [cpp]
#include <iostream>
#include <array>
#include <algorithm>
#include <map>
#include <vector>
#include <list>
#include <cmath>
#include <stack>
#include <queue>
#include <climits>
#include <string.h>
#include <cctype>
#include <set>

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using namespace std;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

// a と b の最大公約数を返す関数
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
	ll x; // typedef long long ll;
	mint(ll x = 0) :x((x% mod + mod) % mod) {}
	mint operator-() const { return mint(-x); }
	mint& operator+=(const mint a) {
		if ((x += a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator-=(const mint a) {
		if ((x += mod - a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; }
	mint operator+(const mint a) const { return mint(*this) += a; }
	mint operator-(const mint a) const { return mint(*this) -= a; }
	mint operator*(const mint a) const { return mint(*this) *= a; }
	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	// for prime mod
	mint inv() const { return pow(mod - 2); }
	mint& operator/=(const mint a) { return *this *= a.inv(); }
	mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }

struct combination {
	vector<mint> fact, ifact;
	combination(int n) :fact(n + 1), ifact(n + 1) {
		fact[0] = 1;
		for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
		ifact[n] = fact[n].inv();
		for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
	}
	mint operator()(int n, int k) {
		if (k < 0 || k > n) return 0;
		return fact[n] * ifact[k] * ifact[n - k];
	}
} comb(2000005);

mint g(int r, int c) {
	return comb(r + c + 2, r + 1) - 1;
}

bool comp(int i, int j) {
	return i > j;
}

int main()
{
	string s;
	cin >> s;

	for (int i = 1; i < 4; i++)
	{
		if (s[i - 1] == s[i])
		{
			cout << "Bad";
			return 0;
		}
	}
	cout << "Good";
}
//  [cpp]
#include <bits/stdc++.h>

typedef long long int ll;

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    
    string s;
    cin >> s;
    
    for (int i = 1; i < (int) s.length(); ++i)
    {
        if (s[i] == s[i - 1])
        {
            cout << "Bad\n";
            return 0;
        }
    }
    
    cout << "Good\n";

    return 0;
}
//  [c]
#include<stdio.h>
int main()
{ 
    char c[5];
  
    scanf("%s",c);
   
    if(c[0]==c[1]) printf("Bad\n");
    else if(c[1]==c[2]) printf("Bad\n");
    else if(c[2]==c[3]) printf("Bad\n");
    else printf("Good\n");
  
    return 0;
}
//  [c]
#include<stdio.h>
int main(void)
{ 
    char S[5];
    scanf("%s",S);
   
    if(S[0]==S[1]) printf("Bad\n");
    else if(S[1]==S[2]) printf("Bad\n");
    else if(S[2]==S[3]) printf("Bad\n");
    else printf("Good\n");
    return 0;
}
//  [javascript]
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = arg[0].split("").map(n=>parseInt(n));
    
    let last = N[0];
    
    for(let i=1; i<N.length; i++) {
        if(last === N[i]) {
            console.log("Bad");
            return;
        }
        
        last = N[i];
    }
    
    console.log("Good");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]

function Main(input) {
    var S = input.toString();

    if (S.charAt(0) === S.charAt(1)) {
        console.log('Bad');
    } else if (S.charAt(1) === S.charAt(2)) {
        console.log('Bad');
    } else if (S.charAt(2) === S.charAt(3)) {
        console.log('Bad');
    } else {
        console.log('Good');
    }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));
//  [javascript]
"use strict";
function main(input) {
    const S = input.replace("\n", "");
    let flg = false;
    for (let i = 1; i < S.length; i++) {
        if (S[i - 1] === S[i]) {
            flg = true;
            break;
        }
    }
    console.log(flg ? "Bad" : "Good");
    return;
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));