function Main(input) { const src = input.split("\n") const a = src[0]; const b = src[1]; let ans = "NG"; const regexp = new RegExp(/^(0|[1-9][0-9]*)$/); if (regexp.test(a) && regexp.test(b) && a <= 12345 && b <= 12345) ans = "OK"; console.log(ans); } Main(require("fs").readFileSync("/dev/stdin", "utf8"));