import macros macro Please(x): untyped = nnkStmtList.newTree() Please use Nim-ACL Please use Nim-ACL Please use Nim-ACL #[ include daylight/base ]# when not declared DAYLIGHT_BASE_HPP: const DAYLIGHT_BASE_HPP* = 1 import system import macros import algorithm import tables import sets import lists import intsets import critbits import sequtils import strutils import std/math import strformat import sugar let readToken* = iterator(oneChar: bool = false): string {.closure.}= while true: var line = stdin.readLine.split for s in line: if oneChar: for i in 0.. b: a = b return true return false proc chmax*[T](a: var T, b: T): bool {.discardable.} = if a < b: a = b return true return false const INF* = (1e9+100).int const LINF* = (4e18 + 100).int discard proc solve() = var (N, K, T) = read(int, int, int) C = read(string) L = -1 R = -1 for i in countdown(K-2,0): if C[i] != C[K - 1]: L = i break for i in countup(K,N-1): if C[i] != C[K-1]: R = i break if L != -1 and (K - 1 - L ) mod 2 == 1 and (K - 1 - L) <= T: echo (if C[K-1] == 'A': "Alice" else: "Bob") return if R != -1 and (R - K + 1) mod 2 == 1 and (R - K + 1) <= T: echo (if C[K-1] == 'A': "Alice" else: "Bob") return echo if C[K-1] == 'A': "Bob" else: "Alice" solve()