P26358 [AtCoder] Color Game
NOI
题目描述

Problem Description

There are $ n $ white stones arranged in a straight line with equal intervals. The distance between adjacent stones is $ 1 $.

Two players play a game with these stones. Each player, on their turn, selects one white stone and turns it black. However, a player cannot choose a stone that is within a distance of $ k $ from the stone that turned black in the previous turn.

The player who cannot choose a white stone first loses the game.

Determine which player, the first or the second, wins when both play optimally.

Input Format

The input is given in the following format:

$ n $ $ k $

  • The first line contains an integer $ n $ ($1 \leq n \leq 50$), representing the number of stones, and an integer $ k $ ($0 \leq k \leq n$), representing the forbidden distance.

Output Format

Output first if the first player wins, or second if the second player wins, in one line.

End with a newline and do not include any extra characters or blank lines.

Sample Input and Output

Sample Input #1

2 1

Sample Output #1

first

Sample Input #2

3 0

Sample Output #2

first

Notes/Hints

Sample Explanation 1

Regardless of which stone is chosen, the other stone cannot be chosen on the next turn, so the first player wins.

Sample Explanation 2

Regardless of the order in which the stones are chosen, all three stones will turn black, so the first player wins.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
2 1
样例输出
first