350 传统题

[ABC485B] 水龙头与排水口 (Faucets and Drains)

时间限制
2000ms
内存限制
1024MiB
登顶 / 尝试
1/ 1
难度
1
    上传者 标签AtCoderABC 485入门二维数组模拟

[ABC485B] 水龙头与排水口 (Faucets and Drains)

Score : 200200 points

Problem Statement

A water tank has NN faucets 1,2,…,N1,2,\dots,N and MM drains 1,2,…,M1,2,\dots,M. Exactly one of the NN faucets and MM drains is clogged.

You are given NN strings S1,S2,…,SNS_1,S_2,\dots,S_N, each of length MM and consisting of o and x. The jj-th character of SiS_i is o if water comes out of drain jj when water is poured from faucet ii (that is, neither faucet ii nor drain jj is clogged), and x otherwise.

Identify which of the NN faucets and MM drains is clogged. It is guaranteed that the answer can be uniquely determined from the input.

Constraints

  • 2≤N≤1002 \leq N \leq 100

  • 2≤M≤1002 \leq M \leq 100

  • NN and MM are integers.

  • SiS_i is a string of length MM consisting of o and x.

  • The answer can be uniquely determined.

Input

The input is given from Standard Input in the following format:

$N$ $M$
$S_1$
$S_2$
$\vdots$
$S_N$

Output

Print the answer in one line. If faucet ii is clogged, print Faucet and ii separated by a space. If drain jj is clogged, print Drain and jj separated by a space.

Sample Input 1

3 4
oooo
xxxx
oooo

Sample Output 1

Faucet 2

Faucet 22 is clogged.

Sample Input 2

4 3
oxo
oxo
oxo
oxo

Sample Output 2

Drain 2

Sample Input 3

2 2
xo
xo

Sample Output 3

Drain 1