CF293A.Weird Game

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Yaroslav, Andrey and Roman can play cubes for hours and hours. But the game is for three, so when Roman doesn't show up, Yaroslav and Andrey play another game.

Roman leaves a word for each of them. Each word consists of 2n2·n binary characters "0" or "1". After that the players start moving in turns. Yaroslav moves first. During a move, a player must choose an integer from 1 to 2n2·n , which hasn't been chosen by anybody up to that moment. Then the player takes a piece of paper and writes out the corresponding character from his string.

Let's represent Yaroslav's word as s=s1s2... s2ns=s_{1}s_{2}...\ s_{2n} . Similarly, let's represent Andrey's word as t=t1t2... t2nt=t_{1}t_{2}...\ t_{2n} . Then, if Yaroslav choose number kk during his move, then he is going to write out character sks_{k} on the piece of paper. Similarly, if Andrey choose number rr during his move, then he is going to write out character trt_{r} on the piece of paper.

The game finishes when no player can make a move. After the game is over, Yaroslav makes some integer from the characters written on his piece of paper (Yaroslav can arrange these characters as he wants). Andrey does the same. The resulting numbers can contain leading zeroes. The person with the largest number wins. If the numbers are equal, the game ends with a draw.

You are given two strings ss and tt . Determine the outcome of the game provided that Yaroslav and Andrey play optimally well.

输入格式

The first line contains integer nn ( 1<=n<=1061<=n<=10^{6} ). The second line contains string ss — Yaroslav's word. The third line contains string tt — Andrey's word.

It is guaranteed that both words consist of 2n2·n characters "0" and "1".

输出格式

Print "First", if both players play optimally well and Yaroslav wins. If Andrey wins, print "Second" and if the game ends with a draw, print "Draw". Print the words without the quotes.

输入输出样例

  • 输入#1

    2
    0111
    0001
    

    输出#1

    First
    
  • 输入#2

    3
    110110
    001001
    

    输出#2

    First
    
  • 输入#3

    3
    111000
    000111
    

    输出#3

    Draw
    
  • 输入#4

    4
    01010110
    00101101
    

    输出#4

    First
    
  • 输入#5

    4
    01100000
    10010011
    

    输出#5

    Second
    
首页