<commit_before>n = int(input())
p = int(input())
k = int(input()) % n

a = ((((p - 1) - ((p - 1) % 2 * 2 - 1) * k) % n - 1) % n - (p % 2 * 2 - 1) * k) % n + 1
b = ((((p - 1) - ((p - 1) % 2 * 2 - 1) * k) % n + 1) % n - (p % 2 * 2 - 1) * k) % n + 1
print(min(a, b), max(a, b))<commit_msg>исправлена ошибка в арифметике номеров<commit_after>n = int(input())
p = int(input())
k = int(input()) % n
a = (p - 2 + (p % 2 * 2 - 1) * 2 * k) % n + 1
b = (p     + (p % 2 * 2 - 1) * 2 * k) % n + 1
print(min(a, b), max(a, b))
{'fraction_non_alphanumeric': 0.287109375, 'fraction_numerical': 0.060546875, 'mean_word_length': 2.0535714285714284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3683984', 'n_tokens_mistral': 288, 'n_tokens_neox': 259, 'n_words': 84}