Fedora Project

Avengers Endgame

Alike the previous part, Thanos will again be visiting our blue planet but this will be his last visit there as he is going to be killed either by Iron Man or Captain America. Thanos has a total power P which is reduced by some amount while fighting. In order to be killed, his power must become smaller than or equal to Zero.

Both the Superheroes fight with Thanos on alternate days, Iron Man fighting on Day 1,3,5,7… . and Captain America on Day 2,4,6,8… and so on until Thanos doesn’t get killed. On any given day D they can reduce the power of Thanos either by D or D+1. Both the superheroes want Thanos to get killed by their hands and for this they fight optimally with him. Being the Director of this part, you want to know that for a given power P of Thanos, who will be the superhero killing him. Write a code to solve the following problem.

Note :

Think of the most optimal solution you can think of :) (Brute Force solution will not be accepted)

INPUT FORMAT

First line of input is N which is the number of test cases. Only line of test case is an integer D which is the power of Thanos.

OUTPUT FORMAT

For each test case, print "IRON MAN" if Iron Man kills Thanos and "CAPTAIN AMERICA" if Captain America kills Thanos, in a new line.

SAMPLE INPUT

5

1

2

4

1000000000000000

10000000000000000

SAMPLE OUTPUT

IRON MAN

IRON MAN

CAPTAIN AMERICA

IRON MAN

CAPTAIN AMERICA

Constraints

1<=T<=10^6

1<=P<=10^16

SUBMISSION FORMAT

Attach your code here. Languages- C,C++, Java, Python3 Test cases:

Task tags

  • quality_task
  • code
  • algorithms

Students who completed this task

Andrew Qi Tang, Rajvardhan, geek123, paraxor, Abtaha, Dhruv985, richmondvan, bananasaurus, iiliffe, UTx10101, zxyl, m1m3, Aggu_01000101, EmperorAj, CodeMagic, srikavin

Task type

  • code Code
close

2019