#CCBOTPBA0000037. Anton and Danik
Anton and Danik
Anton and Danik
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Anton and Danik play n games with no draws; A marks an Anton win and D a Danik win. Compare win counts and print the exact winner name or Friendship for a tie.
Input
First n and then a length-n string using A and D.
Output
Exactly Anton, Danik, or Friendship.
Subtasks
-
Subtask 1 (20%):
1 ≤ n ≤ 20. -
Subtask 2 (30%):
1 ≤ n ≤ 1000. -
Subtask 3 (50%):
1 ≤ n ≤ 100000.
Examples
Example 1
Input:
6
DADADA
Output:
Friendship
Explanation: Each player wins exactly three games.
Example 2
Input:
6
ADAAAA
Output:
Anton
Explanation: Anton wins five of six games.