jiahuimbzuai/CoQuIR huggingface dataset:
//  [javascript]
function Main(input) {
  input = input.split("\n");
  var h = parseInt(input[0].split(" ")[0]);
  var w = parseInt(input[0].split(" ")[1]);
  a = new Array(h);
  for(i=0;i<h;i++){
    asub=new Array(w);
    var x = input[i+1];
    for(j=0;j<w;j++){
      a[i]=asub;
      a[i][j]=x.substr(j,1);
    }
  }
  for(i=h-1;i>=0;i--){
    var cnt=0;
    for(j=0;j<w;j++){
      if(a[i][j]=="#"){
        cnt++;
      }
    }
    if(cnt==0){
      a.splice(i,1);
    }
  }
  for(i=w-1;i>=0;i--){
    var cnt=0;
    for(j=0;j<a.length;j++){
      if(a[j][i]=="#"){
        cnt++;
      }
    }
    if(cnt==0){
      for(j=0;j<a.length;j++){
        a[j].splice(i,1);
      }
    }
  }
  var ans ="";
  for(i=0;i<a.length;i++){
    for(j=0;j<a[i].length;j++){
      ans+=a[i][j];
      if(j==a[i].length-1&&i!=a.length-1){
        ans+="\n";
      }
    }
  }
  console.log('%s', ans);
}
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 fn(input){
  var f = false
  for(var i=0;i<input.length;i++){
    if(!input[i].match(/\#/)){
      input.splice(i,1)
      i--
      f = true
    }
  }
  for(var i=0;i<input.length;i++){
    input[i] = input[i].split("")
  }
  for(var i=0;i<input[0].length;i++){
    var flag = true
    for(var j=0;j<input.length;j++){
      if(input[j][i]=="#") flag=false
    }
    if(flag){
      for(var j=0;j<input.length;j++){
        input[j].splice(i,1)
      }
      j--
      f = true
    }
  }
  for(var i=0;i<input.length;i++){
    input[i] = input[i].join("")
  }
  input = input.join("\n")
  return [f,input]
}

function main (input){
  input.splice(0,1)
  var a = fn(input)
  
  while(a[0]){
    a = fn(input)
  }
  
  console.log(a[1])
}
//  [go]
package main

import (
	"fmt"
	"bufio"
	"os"
	"strings"
)

const (
	WHITE = "."
	BLACK = "#"
)

type Surface []Line
type Line string

func (surface Surface) deleteLine() Surface {
	var stringSlice Surface
	for _,val := range surface {
		if val.contains("#") {
			stringSlice = append(stringSlice,val)
		}
	}
	return stringSlice
}

func (surface Surface) horizonToVertical() Surface {
	vertical := make(Surface,len(surface.String()))
	for _,val := range surface {
		str := strings.Split(val.String(),"")
		for i,v := range str {
			vertical[i] += Line(v)
		}
	}

	return vertical
}

func (surface Surface) String() string {
	var str string
	for _,val := range surface {
		str += fmt.Sprintln(val)
	}
	return strings.Join(strings.Split(str,"")[:len(str)-1],"")
}

func (line Line) contains(str string) bool {
	return strings.Contains(line.String(),str)
}


func (line Line) String() string{
	return fmt.Sprint(string(line))
}

func main() {
	var H,W int
	var stringSlice Surface

	fmt.Scan(&H)
	fmt.Scan(&W)

	input := bufio.NewScanner(os.Stdin)
	
	for index := 0; index < H; index++ {
		input.Scan()
		stringSlice = append(stringSlice,Line(input.Text()))
	}
	
	fmt.Println(stringSlice.deleteLine().horizonToVertical().deleteLine().horizonToVertical())
}
//  [go]
package main

import "fmt"

func main() {
	var h, w int
	fmt.Scanf("%d %d\n", &h, &w)

	grid := make([]string, h)
	for i := 0; i < h; i++ {
		fmt.Scanf("%s\n", &grid[i])
	}

	hl, wl := map[int]bool{}, map[int]bool{}

	for i := 0; i < h; i++ {
		flg := true
		for j := 0; j < w; j++ {
			if string(grid[i][j]) != "." {
				flg = false
				break
			}
		}
		if flg {
			hl[i] = true
		}
	}

	for i := 0; i < w; i++ {
		flg := true
		for j := 0; j < h; j++ {
			if string(grid[j][i]) != "." {
				flg = false
				break
			}
		}
		if flg {
			wl[i] = true
		}
	}

	for i := 0; i < h; i++ {
		if !hl[i] {
			for j := 0; j < w; j++ {
				if !wl[j] {
					fmt.Print(string(grid[i][j]))
				}
			}
			fmt.Print("\n")
		}
	}

}
//  [go]
package main

import "fmt"

func main() {
	// Code for B - Grid Compression
	var H, W int
	fmt.Scanf("%d %d", &H, &W)

	a := make([]string, 0)
	var S string
	var flag int
	for i := 0; i < H; i++ {
		fmt.Scanf("%s", &S)
		flag = 0
		for j := 0; j < W; j++ {
			if S[j] == '#' {
				flag = 1
			}
		}
		if flag == 1 {
			a = append(a, S)
		}
	}

	ans := make([]int, 0)
	for i := 0; i < W; i++ {
		flag = 0
		for j := 0; j < len(a); j++ {
			if a[j][i] == '#' {
				flag = 1
			}
		}
		if flag == 1 {
			ans = append(ans, i)
		}
	}
	for i := 0; i < len(a); i++ {
		for _, v := range ans {
			fmt.Printf("%c", a[i][v])
		}
		fmt.Printf("\n")
	}

}
//  [ruby]
h,w=gets.split.map(&:to_i);a=(1..h).map{gets.chars};h.times{|i|a[i].any?{|x|x=='#'}&&0.upto(w){|j|a.transpose[j].count('.')<h&&(print a[i][j])}}
//  [ruby]
h,w=gets.split.map(&:to_i)
a=(1..h).map{gets.chars}
h.times{|i|
  if a[i].any?{|x|x=='#'} then
    0.upto(w){|j|
      if a.transpose[j].count('.')<h then
        print a[i][j]
      end
    }
  end
}
//  [ruby]
h,w=gets.split.map(&:to_i)
a=[*1..h].map{gets}
def check(arr,y,x,h,w)
  flag1=0
  flag2=0
  h.times{|i|
    if arr[i][x]=='#' then flag1=1 end
  }
  w.times{|j|
    if arr[y][j]=='#' then flag2=1 end
  }
  return flag1+flag2>1
end
h.times{|j|
  f=0
  w.times{|i|
    if check(a,j,i,h,w) then print a[j][i]; f=1 end
  }
  if f==1 then puts "" end
}
//  [rust]
#![allow(non_snake_case, unused_imports)]

// Input
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, bytes) => { read_value!($next, String).into_bytes() }; ($next:expr, usize1) => { read_value!($next, usize) - 1 }; ($next:expr, $t:ty) => { $next().parse::<$t>().expect("Parse error") }; }

// Module
use std::cmp::{min,max};
use std::collections::{HashSet,BTreeMap,VecDeque};

// Functions

// Main
fn main(){
    input!{
        H: usize,
        W: usize,
        A: [chars; H],
    }
    let mut hh = vec![];
    let mut ww = vec![];
    for h in 0..H{
        for w in 0..W{
            if A[h][w]=='#'{
                hh.push(h);
            }
        }
    }
    for w in 0..W{
        for h in 0..H{
            if A[h][w]=='#'{
                ww.push(w);
            }
        }
    }
    for h in 0..H{
        for w in 0..W{
            if hh.contains(&h) && ww.contains(&w){
                print!("{}",A[h][w]);
            }
        }
        if hh.contains(&h){
            println!("{}","");
        }
    }
}
//  [rust]
use proconio::{input, fastout};
use std::collections::HashSet;

#[fastout]
fn main() {
    input! {
        h: usize, w: usize,
        arr: [proconio::marker::Chars; h],
    }

    let mut dots_col = vec![0; w];
    let mut rows_to_remove: HashSet<usize> = HashSet::new();
    for (i, chars) in arr.iter().enumerate() {
        let mut dot_cnt = 0;
        for (j, c) in chars.iter().enumerate() {
            if c == &'.' {
                dot_cnt += 1;
                dots_col[j] += 1;
            }
        }
        if dot_cnt == w { rows_to_remove.insert(i); }
    }

    let arr2 = arr.into_iter().enumerate()
        .filter(|(i,_)| !rows_to_remove.contains(i))
        .map(|(_,c)| c).collect::<Vec<Vec<char>>>();

    let omit_idx = dots_col.iter().enumerate()
        .filter(|(_,e)| e==&&h).map(|(i,_)| i).collect::<HashSet<usize>>();

    for chars in arr2 {
        for (i, c) in chars.iter().enumerate() {
            if !omit_idx.contains(&i) { print!("{}", c) }
        }
        println!();
    }
}
//  [rust]
#![allow(unused_imports)]

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

fn main() {
    input! {
    a:usize,
    b:usize,
    c:[String;a],
    }
    let mut c =c.iter().map(|a|a.chars().collect_vec()).collect_vec();
    let mut t = vec![0;a];
    let mut y = vec![0;b];
    for i in 0..a {
        for j in 0..b {
            if c[i][j]=='#' {t[i]=1;y[j]=1;}
        }
    }
    let tt=t.iter().sum();
    let yy=y.iter().sum();
    let mut ttt=0;
    let mut yyy=0;
    let mut v:Vec<Vec<char>>=vec![vec!['.';yy];tt];
    for i in 0..a {
        if t[i]==1 {
            ttt+=1;
        }
        for j in 0..b {
            if y[j]==1 {
                yyy+=1;
            }
            if t[i]==1&&y[j]==1 {
                if c[i][j]=='#' {
                    v[ttt-1][yyy-1]='#'
                }
            }
        }
        yyy=0
    }
    let v:Vec<String>=v.iter().map(|a|a.iter().collect()).collect_vec();
    for i in 0..tt {
        println!("{}",v[i])
    }
}
//  [swift]
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    var count: Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
}
extension Array where Element: Comparable {
    func max() -> Element {
        return self.maxElement()!
    }
    func min() -> Element {
        return self.minElement()!
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/



/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
let (H, W) = (input[0], input[1])
let a = (0..<H).map{_ in readLine()!.toArray()}

var row = [Bool](repeating: false, count: H)
var col = [Bool](repeating: false, count: W)
for i in 0..<H {
    for j in 0..<W {
        if a[i][j] == "#" {
            row[i] = true
            col[j] = true
        }
    }
}

for i in 0..<H {
    if row[i] == true {
        for j in 0..<W {
            if col[j] == true {
                print(a[i][j], terminator: "")
            }
        }
        print()
    }
}
//  [python]
a,b=map(int,input().split())
A=str(a)*b
B=str(b)*a
for i in range(min(len(A),len(B))):
  if int(A[i])>int(B[i]):
    print(B)
    break
  elif int(A[i])<int(B[i]):
    print(A)
    break
  if i==min(len(A),len(B))-1:
    print(A)
//  [python]
a, b = input().split()
print(max(int(a*int(b)), int(b*int(a))))
//  [python]
a, b=input().split()
A = int(a)
B = int(b)

if (A > B):
    print(b * A)
else:
    print(a * B)
//  [python]
#!/usr/bin/env python3
import numpy as np


DEBUG = True
dprint = print if DEBUG else lambda *x : x

a, b = [int(str) for str in input().strip().split()]

ss = str(a) * b, str(b) * a

print(min((ss)))
//  [python]
import numpy as np

x = list(map(int,input().split()))
if x[0] > x[1]:
    ans = np.repeat(x[1],x[0])
    for i in ans:
        print(i, end="")
    
elif x[0] < x[1]:
    ans = np.repeat(x[0],x[1])
    for i in ans:
        print(i, end="")
    
else:
    ans = np.repeat(x[0],x[1])
    for i in ans:
        print(i, end="")
//  [python]
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/
#
# lang: Python3 (3.4.3)

import math
import statistics
import numpy as np
import queue

a,b = map(int, input().split())
if a < b:
  for i in range(b):
    print(a, end = '')
else:
  for i in range(a):
    print(b, end = '')
print('')
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    private static final int MOD = (int) Math.pow(10, 9);
    private static final int[][] DIRECTIONS = {{1, 1}, {0, 1}, {-1, 1}, {1, 0}, {-1, 0}, {0, -1}};

    public static void main(String[] args) {
        FastReader sc = new FastReader();
        int a = sc.nextInt();
        int b = sc.nextInt();

        if (a > b) {
            int tmp = a;
            a = b;
            b = tmp;
        }

        String res = "";

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

        System.out.println(res);
        System.exit(0);
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            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 nextInt() {
            return Integer.parseInt(next());
        }

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

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

        String nextLine() {
            String str = "";
            try{
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}
//  [java]
import java.util.*;
import java.io.*;

public class Main {

  void solve(InputReader in, PrintWriter out) {
    int a = in.nextInt();
    int b = in.nextInt();

    if (a <= b) {
      for (int i = 0; i < b; ++i)
        out.print(a);
    } else {
      for (int i = 0; i < a; ++i)
        out.print(b);
      
    }
  }

  public static void main(String[] args) throws Exception {
    InputReader in = new InputReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    Main solver = new Main();
    solver.solve(in, out);
    out.close();
  }

  static class InputReader {
    BufferedReader in;
    StringTokenizer st;

    public InputReader(InputStream is) {
      in = new BufferedReader(new InputStreamReader(is));
    }

    public String next() {
      try {
        while (st == null || !st.hasMoreTokens()) {
          st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }

    public int nextInt() {
      return Integer.parseInt(next());
    }

    public long nextLong() {
      return Long.parseLong(next());
    }
  }
}
//  [java]
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    String aStr = Integer.toString(a);
    int b = sc.nextInt();
    String bStr = Integer.toString(b);

    StringBuilder aResult = new StringBuilder();
    for (int i = 0; i < b; i++) {
      aResult.append(aStr);
    }

    StringBuilder bResult = new StringBuilder();
    for (int i = 0; i < a; i++) {
      bResult.append(bStr);
    }

    List<String> list = new ArrayList<>();
    list.add(aResult.toString());
    list.add(bResult.toString());
    List<String> sortedList = list.stream().sorted().collect(Collectors.toList());

    System.out.println(sortedList.get(0));
  }
}
//  [java]
import java.util.*;
import java.util.function.*;
import java.util.stream.*;

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

	void solve(){
		int a=gInt(),b=gInt();
		String x="",y="";

		for(int i:rep(a))
			x+=b;
		for(int i:rep(b))
			y+=a;

		System.out.println(a<b?y:x);
	}

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

	int gInt(){
		return Integer.parseInt(s.next());
	}
	long gLong(){
		return Long.parseLong(s.next());
	}
	double gDouble(){
		return Double.parseDouble(s.next());
	}

	SupplyingIterator<Integer> ints(int n){
		return new SupplyingIterator<>(n,this::gInt);
	}
	SupplyingIterator<Long> longs(int n){
		return new SupplyingIterator<>(n,this::gLong);
	}
	SupplyingIterator<Double> doubles(int n){
		return new SupplyingIterator<>(n,this::gDouble);
	}
	SupplyingIterator<String> strs(int n){
		return new SupplyingIterator<>(n,s::next);
	}

	Range rep(int i){
		return Range.rep(i);
	}
	Range rep(int f,int t,int d){
		return Range.rep(f,t,d);
	}
	Range rep(int f,int t){
		return rep(f,t,1);
	}
	Range rrep(int f,int t){
		return rep(t,f,-1);
	}

	IntStream REP(int v){
		return IntStream.range(0,v);
	}
	IntStream REP(int l,int r){
		return IntStream.rangeClosed(l,r);
	}

	IntStream INTS(int n){
		return IntStream.generate(this::gInt).limit(n);
	}
	Stream<String> STRS(int n){
		return Stream.generate(s::next).limit(n);
	}

}

class SupplyingIterator<T> implements Iterable<T>,Iterator<T>{
	int			t;
	Supplier<T>	supplier;

	SupplyingIterator(int t,Supplier<T> supplier){
		this.t=t;
		this.supplier=supplier;
	}

	@Override
	public Iterator<T> iterator(){
		return this;
	}

	@Override
	public boolean hasNext(){
		return t>0;
	}

	@Override
	public T next(){
		--t;
		return supplier.get();
	}

}

class Range implements Iterable<Integer>,PrimitiveIterator.OfInt{
	int to,cur,d;

	Range(int from,int to,int d){
		this.cur=from-d;
		this.to=to;
		this.d=d;
	}

	Range(int n){
		this(0,n-1,1);
	}

	@Override
	public Iterator<Integer> iterator(){
		return this;
	}

	@Override
	public boolean hasNext(){
		return cur+d==to||(cur!=to&&(cur<to==cur+d<to));
	}

	@Override
	public int nextInt(){
		return cur+=d;
	}
	static Range rep(int i){
		return new Range(i);
	}
	static Range rep(int f,int t,int d){
		return new Range(f,t,d);
	}
	static Range rep(int f,int t){
		return rep(f,t,1);
	}
	static Range rrep(int f,int t){
		return rep(f,t,-1);
	}
}
//  [java]
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int a = Integer.parseInt(sc.next());
    int b = Integer.parseInt(sc.next());
    String aString = IntStream.range(0, b).mapToObj(i -> String.valueOf(a))
      .collect(Collectors.joining());
    String bString = IntStream.range(0, a).mapToObj(i -> String.valueOf(b))
      .collect(Collectors.joining());
    List<String> list = Arrays.asList(aString, bString);
    Collections.sort(list);
    pw.println(list.get(0));
  }
}
//  [cpp]
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <string.h>

using namespace std;
typedef long long ll;

int main()
{
	int a, b;
	scanf("%d %d", &a, &b);
	
	if(a == b){
		for(int i = 0; i < b; i++){
			printf("%d",a);
		}
		printf("\n");
	}else if(a < b){
		for(int i = 0; i < b; i++){
			printf("%d", a);
		}
		printf("\n");
	}else{
		for(int i = 0; i < a; i++){
			printf("%d", b);
		}
		printf("\n");
	}
	
	return 0;
}
//  [cpp]
#include <stdio.h>

int main(void)
{
    int a, b, i;

    scanf("%d %d" ,&a, &b);

    if (a < b)
        for (i = 1; i <= b; i++)
            printf("%d" ,a);
    else
        for (i = 1; i <= a; i++)
            printf("%d" ,b);
    return 0;
}
//  [cpp]
#include <stdio.h>

void solve(int a,int n) {

	for (int i = 0; i < n; ++i) printf("%d", a);
	puts("");
}

int main() {

	int a, b;
	scanf("%d %d", &a, &b);
	a < b ? solve(a, b) : solve(b, a);

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

int main (void){
  int a, b, i;
  
  scanf("%d%d", &a, &b);
  if (a <= b)
  {
    for(i = 0; i < b; i++){
      printf("%d",a);
    }
  }
  else
  {
    for(i = 0; i < a; i++){
      printf("%d",b);
    }
  }
  
  return(0);
}
//  [c]
#include<stdio.h>

int main(void)
{
  int a, b, i;
  
  scanf("%d %d", &a, &b);
  if(a > b){
    for(i=0; i<a; i++){
      printf("%d", b);
    }
  }else{
    for(i=0; i<b; i++){
      printf("%d", a);
    }
  }
  
  return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>
int main()
{
    int a,b,i,j;
    char s1[15],s2[15];
    scanf("%d %d",&a,&b);
    for(i=0;i<b;i++)
    {
        s1[i]=a+'0';

    }
    s1[i]='\0';
     for(j=0;j<a;j++)
    {
        s2[j]=b+'0';

    }
    s2[j]='\0';
     if(a<b)
     {
        printf("%s\n",s1);
     }
     else if(a>b)
     {
        printf("%s\n",s2);
     }
      else if(a==b)
     {
        printf("%s\n",s2);
     }



    return 0;
}
//  [c]
#include<stdio.h>
int main()
{
  int a,b,i;
  scanf("%d %d",&a,&b);
  if(a<b){
        for(i=1;i<=b;i++)
        {
          printf("%d",a);
        }
    }
    else{
        for(i=1;i<=a;i++)
        {
          printf("%d",b);
        }
    }
}
//  [c]
#include<stdio.h>
#include<string.h>
int main()
{
    int a,b,i;
    scanf("%d %d",&a,&b);
    if(a<=b)
    {
        for(i=0;i<b;i++)
        {
            printf("%d",a);
        }
        printf("\n"); 
    }
    else if(a>b)
    {
        for(i=0;i<a;i++)
        {
            printf("%d",b);
        }
        printf("\n"); 
    }
    return 0;
}
//  [c]
#include "stdio.h"
int main(){
  int a,b,res,c;
  scanf("%d%d",&a,&b);
  if(a>b){
    res=b;
    c=a;
  }
  else{
    res=a;
    c=b;
  }
  for(int i=0;i<c;i++){
    printf("%d",res);
  }
  return 0;
}
//  [javascript]
"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ').map(v=>parseInt(v,10));
   let ans = '';
   if(xs[0]>xs[1]){
     for(let i=0; i<xs[0]; i++){
        ans += xs[1];
     }
    }else if(xs[0]<xs[1]){
      for(let i=0; i<xs[1]; i++){
         ans += xs[0];
        }
    }else{
    　for(let i=0; i<xs[0]; i++){
        　ans += xs[0];
         }
    }
    console.log(ans);
   }

Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [javascript]
"use strict";
function main(input) {
    let line = input.split(/\r?\n/g);
    let arr = line[0].split(" ");
    const a = parseInt(arr[0]), b = parseInt(arr[1]);
    console.log(a < b ? String(a).repeat(b) : String(b).repeat(a))
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function main(arg) {
	arg = arg.trim().split(' ');
    var min = Math.min(arg[0], arg[1]),
  		max = Math.max(arg[0], arg[1]);
    var out = '';
    for(var i = 0; i < max; i++) {
        out += min
    }
    console.log(out)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
"use strict";
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(myOut);
function main(){
  var a = o.a();
  var b = o.a();
  var c = "", d = "";
  for(var i = 0; i < a; i++){
    c += b;
  }
  for(var i = 0; i < b; i++){
    d += a;
  }
  return c > d ? d : c;
}
//  [go]
package main

import (
	"fmt"
	"strconv"
	"strings"
)

func main() {
	var a, b int
	fmt.Scanf("%d %d", &a, &b)
	if a <= b {
		fmt.Println(strings.Repeat(strconv.Itoa(a), b))
	} else {
		fmt.Println(strings.Repeat(strconv.Itoa(b), a))
	}
}
//  [go]
package main

import (
  "fmt"
  "strings"
  "strconv"
)

func main() {
  var a, b int
  fmt.Scan(&a, &b)
  var res string
  if a <= b {
    res = strings.Repeat(strconv.Itoa(a), b)
  } else {
    res = strings.Repeat(strconv.Itoa(b), a)
  }

  fmt.Println(res)

}
//  [go]
package main

import (
	"fmt"
	"strconv"
	"strings"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	as := strings.Repeat(strconv.Itoa(a), b)
	bs := strings.Repeat(strconv.Itoa(b), a)

	if as < bs {
		fmt.Println(as)
	} else {
		fmt.Println(bs)
	}
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	scanInit()

	a := nextInt()
	b := nextInt()
	astr := strings.Repeat(fmt.Sprintf("%d", a), b)
	bstr := strings.Repeat(fmt.Sprintf("%d", b), a)

	if astr < bstr {
		fmt.Println(astr)
	} else {
		fmt.Println(bstr)
	}
}

// ---- readfunc
func scanInit() {
	const cap = 200 * 1024 // default=64*1024
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}
//  [go]
package main

import (
	"fmt"
	"strconv"
)

func main() {
	var (
		a, b int
	)
	fmt.Scan(&a, &b)
	if a < b {
		fmt.Print(pras(b, a))
	} else {
		fmt.Print(pras(a, b))
	}
}

func pras(j, p int) string {
	var t string
	for i := 0; i < j; i++ {
		t += strconv.Itoa(p)
	}
	return t
}
//  [ruby]
a, b = gets.split.map(&:to_i)
puts a > b ? b.to_s * a : a.to_s * b
//  [ruby]
a,b = gets.chomp.split.map(&:to_i)

x = a.to_s * b
y = b.to_s * a

puts [x,y].min
//  [ruby]
a, b = readline.split(' ').map(&:to_i)

if a >= b
  puts b.to_s * a
else
  puts a.to_s * b
end
//  [ruby]
x,y=gets.split.map!{|i| i.to_i}
if x>y
  for i in 1..x
    print(y)
  end
else
  for j in 1..y
    print(x)
  end
end
//  [ruby]
a,b = gets.chomp.split(' ').map(&:to_i)
answer = []
answer << (a.to_s)*b
answer << (b.to_s)*a
puts answer.sort.first
//  [ruby]
a,b=gets.split.map(&:to_i).sort
puts a.to_s*b
//  [rust]
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> Option<T> {
    let stdin = stdin();
    let s = stdin
        .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 a: usize = read().unwrap();
    let b: usize = read().unwrap();

    // let aa = a.to_string().repeat(b);
    // let bb = b.to_string().repeat(a);
    let aa = (0..b).map(|_| a.to_string()).collect::<Vec<_>>().concat();
    let bb = (0..a).map(|_| b.to_string()).collect::<Vec<_>>().concat();

    if aa >= bb {
        println!("{}", bb);
    } else {
        println!("{}", aa);
    }
}
//  [rust]
/* {{{ */
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
/* }}} */

fn main() {
    input! {
        a: u32,
        b: u32
    }
    let min = std::cmp::min(a,b);
    let max = std::cmp::max(a,b);
    for _ in 0..max {
        print!("{}", min);
    }
}
/* vim:set foldmethod=marker: */
//  [rust]
use std::io;

fn main() {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let mut iter = buf.split_whitespace();
	let a = match iter.next().unwrap().parse() {
		Ok(n) => n,
		Err(_) => panic!(""),
	};
	let b = match iter.next().unwrap().parse() {
		Ok(n) => n,
		Err(_) => panic!(""),
	};
	if a < b {
		for n in 0..b {
			print!("{}", a);
		}
		print!("\n");
	}else if b < a {
		for n in 0..a {
			print!("{}", b);
		}
		print!("\n");
	}else{
		for n in 0..a {
			print!("{}", a);
		}
		print!("\n");
	}
}
//  [rust]
use proconio::input;
#[allow(unused_mut)]
fn main() {
    input! {
        a: usize,
        b: usize
    }
    let (a, b) = if a > b { (b, a) } else { (a, b) };
    (0..b).for_each(|_| print!("{}", a));
    println!();
}
//  [rust]
use proconio::input;

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

    if a == b {
        println!("{}", a.to_string().repeat(b))
    } else if a > b {
        println!("{}", b.to_string().repeat(a))
    } else {
        println!("{}", a.to_string().repeat(b))
    }
}
//  [swift]
let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

let a = arr[0]
let b = arr[1]

var ans: String = ""
var r: String
var n: Int

if (a < b) {
  r = String(a)
  n = b
} else {
  r = String(b)
  n = a
}

var i = 0
for i in 0..<n {
  ans = ans + r
}

print(ans)
//  [typescript]
'use strict'
const main = (input: string) => {
    const std: string[] = input.split(' ')
    const a: number = ~~std.shift()
    const b: number = ~~std.shift()
    if (a === b) {
        console.log(Array(b).fill(a).join(''))
        return
    }
    const as = Array(a).fill(b).join('')
    const bs = Array(b).fill(a).join('')
    console.log(as < bs ? as : bs)    
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim())
//  [typescript]
"use strict";

const App8 = (arg: any) => {
  const value: string = arg.trim().split("\n");
  const A: number = parseInt(value[0].split(" ")[0], 10);
  const B: number = parseInt(value[0].split(" ")[1], 10);
  if (A > B) {
    console.log(`${B}`.repeat(A));
  } else if(B > A) {
    console.log(`${A}`.repeat(B));
  }else {
    console.log(`${A}`.repeat(A));
  }
}

App8(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
import * as fs from 'fs';

const input = fs.readFileSync('/dev/stdin', 'utf8').split(/[ \n]/);
const a: string = input[0];
const b: string = input[1];

let ansA: string = '';
let ansB: string = '';

for (let i = 0; i < +b; i++) {
  ansA += a;
}
for (let i = 0; i < +a; i++) {
  ansB += b;
}

let list = [ansA, ansB];
list.sort();

if (list[0] == ansA) {
  console.log(+ansA);
} else {
  console.log(+ansB);
}
//  [typescript]
class AtCoder {
  // 入力系
  input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);
  input_i=-1;
  n(){
    this.input_i++;
    return Number(this.input[this.input_i]);
  }
  nn(n){
    const a=[];
    for(let i=0;i<n;i++){
      a.push(this.n());
    }
    return a;
  }
  s(){
    this.input_i++;
    return String(this.input[this.input_i]);
  }
  ss(n){
    const a=[];
    for(let i=0;i<n;i++){
      a.push(this.s());
    }
    return a;
  }

  // コンソール
  o(...a:any){
    console.log(...a);
  }

  // Math
  abs(a:number){
    return Math.abs(a);
  }
  min(...a:number[]){
    return Math.min(...a);
  }
  max(...a:number[]){
    return Math.max(...a);
  }
  floor(a:number){
    return Math.floor(a);
  }
  ceil(a:number){
    return Math.ceil(a);
  }
  round(a:number){
    return Math.round(a);
  }

  // ソート
  asc(ar:number[]){
    const t=[...ar];
    ar.sort((a,b)=>{return a-b});
  }
  desc(ar:number[]){
    const t=[...ar];
    ar.sort((a,b)=>{return b-a});
  }

  // 自作
  gcd(...arr):number{
    for(let i=0;i<arr.length-1;i++){
      let [x,y]=[arr[i],arr[i+1]];
      while(y){
        [x,y]=[y,x%y];
      }
      arr[i+1]=x;
    }
    return arr[arr.length-1];
  };
  lcm(...arr):number{
    for(let i=0;i<arr.length-1;i++){
      let [x,y]=[arr[i],arr[i+1]];
      while(y){
        [x,y]=[y,x%y];
      }
      arr[i+1]=arr[i]*arr[i+1]/x;
    }
    return arr[arr.length-1];
  };
  isPrime(n:number):boolean{
    if(n < 2) return false;
    const suq=Math.sqrt(n);
    for(let i=2;i<=suq;i++){
      if(n%i==0){
        return false;
      }
    }return true;
  };
  deduplicate(a:any[]):any[]{
    return Array.from(new Set(a));
  };
}

/* [入力]
  const [H,W]=o.nn(2)
  const [N,M]=o.nn(2)
  const N=o.n()
  const S=o.s()
  const arr1=[]
  for(let i=0;i<N;i++)arr1.push(o.n())
 */

/* [BFS,DFS]
  const [H,W]=o.nn(2),map=new Array(H),save=new Array(H)
  const DH=[0,0,-1,1]
  const DW=[1,-1,0,0]
  for(let i=0;i<H;i++){
    map[i]=o.s().split('')
    save[i]=new Array(W)
    save[i].fill(-1)
  }
  // let queue=[[?,?,1]]
  // save[?][?]=0
  while(queue.length>0){
    let [h,w,c]=queue.shift()
    for(let i=0;i<4;i++){
      if(h+DH[i]<0 || h+DH[i]>=H || w+DW[i]<0 || w+DW[i]>=W){
        continue
      }
      if(map[h+DH[i]][w+DW[i]]==?){
        continue
      }
      if(save[h+DH[i]][w+DW[i]]==-1){
        queue.push([h+DH[i], w+DW[i], c+1])
        save[h+DH[i]][w+DW[i]]=c
      }
    }
  }
*/
const o = new AtCoder()

let [a,b]=o.nn(2)
let aa=String(a).repeat(b)
let bb=String(b).repeat(a)

if(aa < bb){
  o.o(aa)
}else{
  o.o(bb)
}
//  [typescript]
{
  const main = (
    input: string
  ): void | string | number | string[] | number[] => {
    const r = _reader(input)
    const [a, b] = r.ss()

    return a < b ? a.repeat(Number(b)) : b.repeat(Number(a))
  }

  const _reader = (str: string, i = 0) => {
    const lines = str.trim().split('\n')
    const s = () => lines[i++] || ''
    const n = () => Number(s())

    const mn = (v: string[]) => v.map(Number)
    const sp = (v: string) => v.split(' ')
    const ss = () => sp(s())
    const nn = () => mn(ss())
    const nls = () => mn(lines.slice(i))
    const nnls = () => lines.slice(i).map(v => mn(sp(v)))

    return { lines, s, n, ss, nn, nls, nnls }
  }

  const _getInput = () => require('fs').readFileSync('/dev/stdin', 'utf8')
  const _res = main(_getInput())

  if (typeof _res === 'number' || typeof _res === 'string') console.log(_res)
  if (typeof _res === 'object') console.log(_res.join(' '))
}
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
//const n = +input[0];
//const a = [];
//for(let i=0;i<n;i++){
//	a.push(input[i+1].split(" ").map((x:string):number=>+x));
//}

//const [n, m] = input[0].split(" ").map((x: string): number => +x);
//const a = input[1].split(" ").map((x: string): number => +x);


const [a, b] = input[0].split(" ");

const bb = parseInt(b);
const aa = parseInt(a);
let ab:string = '';
let ba:string = '';
for (let i:number = 0; i< bb; i++){
    ab+=a;
}
for (let i:number = 0; i< aa; i++){
    ba+=b;
}

if(ab<ba){
    console.log(ab);
}else{
    console.log(ba);
}
//  [python]
n=int(input())
a,b=map(int,input().split())
import numpy as np
for ii in np.arange(a,b+1):
  if ii%n==0:
    print("OK")
    exit()
print("NG")
//  [python]
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    K=I()
    A,B=MI()
    if(A%K==0 or A//K!=B//K or B%K==0):
        print("OK")
    else:
        print("NG")
if __name__ == '__main__':
    main()
//  [python]
#!/usr/bin/env python3
# vim: set fileencoding=utf-8

# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation


"""Module docstring
"""

import functools
import heapq
import itertools
import logging
import math
import random
import string
import sys
from argparse import ArgumentParser
from collections import defaultdict, deque
from copy import deepcopy
from typing import Dict, List, Optional, Set, Tuple


def solve(multiple: int, min_value: int, max_value: int) -> bool:
    return max_value - (max_value % multiple) >= min_value


def do_job():
    "Do the work"
    LOG.debug("Start working")
    # first line is number of test cases
    K = int(input())
    A, B = map(int, input().split())
    # values = []
    # for _ in range(N):
    #     values.append(input().split())
    result = solve(K, A, B)
    print("OK" if result else "NG")


def print_output(testcase: int, result) -> None:
    "Formats and print result"
    if result is None:
        result = "IMPOSSIBLE"
    print("Case #{}: {}".format(testcase + 1, result))
    # 6 digits float precision {:.6f} (6 is the default value)
    # print("Case #{}: {:f}".format(testcase + 1, result))


def configure_log() -> None:
    "Configure the log output"
    log_formatter = logging.Formatter("%(lineno)d - " "%(message)s")
    handler = logging.StreamHandler(sys.stdout)
    handler.setFormatter(log_formatter)
    LOG.addHandler(handler)


LOG = None
# for interactive call: do not add multiple times the handler
if not LOG:
    LOG = logging.getLogger("template")
    configure_log()


def main(argv=None):
    "Program wrapper."
    if argv is None:
        argv = sys.argv[1:]
    parser = ArgumentParser()
    parser.add_argument(
        "-v",
        "--verbose",
        dest="verbose",
        action="store_true",
        default=False,
        help="run as verbose mode",
    )
    args = parser.parse_args(argv)
    if args.verbose:
        LOG.setLevel(logging.DEBUG)
    do_job()
    return 0


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    sys.exit(main())


class memoized:
    """Decorator that caches a function's return value each time it is called.
    If called later with the same arguments, the cached value is returned, and
    not re-evaluated.
    """

    def __init__(self, func):
        self.func = func
        self.cache = {}

    def __call__(self, *args):
        try:
            return self.cache[args]
        except KeyError:
            value = self.func(*args)
            self.cache[args] = value
            return value
        except TypeError:
            # uncachable -- for instance, passing a list as an argument.
            # Better to not cache than to blow up entirely.
            return self.func(*args)

    def __repr__(self):
        """Return the function's docstring."""
        return self.func.__doc__

    def __get__(self, obj, objtype):
        """Support instance methods."""
        return functools.partial(self.__call__, obj)
//  [java]
import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		for(int i = b; i <= c; i++){
			if(i % a == 0){
				System.out.print("OK");
				return;
			}
		}
		System.out.print("NG");
	}
}
//  [java]
import java.io.*;
import java.util.*;

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

                int K = scan.nextInt();
                int A = scan.nextInt();
                int B = scan.nextInt();

                int syou = A/K;
                int hantei = K * syou;

                while (true) {
                        if (hantei > B) {
                                System.out.println("NG");
                                break;
                        }
                        if (hantei >= A) {
                                System.out.println("OK");
                                break;
                        }
                        hantei += K;
                }
        }
}
//  [java]
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;

class Main {
    static final int MOD = 1000000007;
    static final int INF = 1 << 30;
    static final int ALF = 26;

    Main() {
        Scanner sc = new Scanner(System.in);
        long ans = 0;
        int K = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        for(int i=0;i<10000;i++){
            if(K*i>=A && K*i<=B){
                System.out.println("OK");
                return;
            }
        }
        System.out.println("NG");
    }

    public static void main(String[] args) {
        new Main();
    }
}
//  [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);
}

long long gcd(long long a, long long b)
{
	if (a % b == 0)
	{
		return(b);
	}
	else
	{
		return(gcd(b, a % b));
	}
}

long long lcm(long long a, long long b)
{
	return a * b / gcd(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;
}

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
	return a.second < b.second;
}

int main()
{
	int k;
	cin >> k;
	int a, b;
	cin >> a >> b;
	if (a % k == 0)
	{
		cout << "OK";
	}
	else
	{
		cout << ((b - a) >= (k - (a % k)) ? "OK" : "NG");
	}
}
//  [c]
#include <stdio.h>

int main()
{
    int k, a, b;
    scanf("%d", &k);
    scanf("%d%d", &a, &b);

    int i = 1, is_possible = 0;

    while(i*k <= b)
    {
        if(i*k >= a)
        {
            is_possible = 1;
            break;
        }

        i++;
    }

    if(is_possible == 1)
        printf("OK\n");

    else
        printf("NG\n");


    return 0;
}
//  [c]
#include<stdio.h>
int main()
{
	int k,a,b;
    scanf("%d%d%d",&k,&a,&b);
   	if(a%k==0)
    printf("OK");
    else
    {
    	if(k*((a/k)+1)<=b)
        printf("OK");
        else
        printf("NG");
    }
    return 0;
}
//  [c]
#include<stdio.h>
int main()
{
	int tc;
	scanf("%d",&tc);
	int A,B;
	scanf("%d %d",&A,&B);
	int flag = 1;
	for(int i = A;i<=B;i++)
	{
		if(i % tc == 0)
		{
			flag = 0;
			break;
		}
	}
	(flag) ? printf("NG\n") : printf("OK\n");
}
//  [javascript]
function main(input){
  input = input.split('\n');
  const K = Number(input[0]);
  const [A, B] = input[1].split(' ').map(Number);

  for(let i=A; i<=B; i++){
    if(i%K ===0){
      console.log('OK')
      return
    }
  }

  console.log('NG');
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim());
//  [javascript]
const main = (input) => {
    input = input.split('\n');
    const K = input[0];
    const tmp = input[1].split(' ');
    const A = parseInt(tmp[0]);
    const B = parseInt(tmp[1]);

    for (let i = A; i <= B; i++) {
        if (i % K === 0) {
            console.log('OK');
            return;
        }
    }

    console.log('NG');
};

// 標準入力
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
package main

import (
	"fmt"
)

func main() {
	var k, a, b int
	fmt.Scanf("%d", &k)
	fmt.Scanf("%d %d", &a, &b)
	if b/k > a/k {
		fmt.Println("OK")
	} else if a%k == 0 || b%k == 0 {
		fmt.Println("OK")
	} else {
		fmt.Println("NG")
	}
}
//  [go]
package main

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


func check(K int,A int,B int) bool {
	for i := A; i <= B; i++ {
		if (i % K == 0) {
			return true
		}
	}
	return false
}

var sc = bufio.NewScanner(os.Stdin)

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

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



func main() {
	sc.Split(bufio.ScanWords)
	K := nextInt()
	A, B := nextInt(), nextInt()
	if  check(K, A, B) {
		fmt.Print("OK")
	} else {
		fmt.Print("NG")
	}

}
//  [ruby]
require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
k = gets.chomp.to_i
a,b = gets.chomp.split.map(&:to_i)

a.upto(b) do |i|
  if i % k == 0
    puts 'OK'
    exit
  end
end

puts 'NG'
//  [ruby]
require 'pp'

# 入力値を数値で返却する
def gets_i()
  gets.chomp.to_i
end

# 空白区切の入力値を数値の配列で返却する
def gets_i_list()
  gets.chomp.split(" ").map(&:to_i)
end

K = gets_i
A, B = gets_i_list


b = B / K

a = A / K

aa = a * K
aaa  = (a+1) * K

if A <= aa && aa <= B  
  puts "OK"
elsif A <= aaa && aaa <= B
  puts "OK"
else
  puts "NG"
end