1.

Ankush challenges Ankit to complete his code which implements the functionality of checking if the first and last name of a student is an anagram of each other or not.

An anagram of a string is another string that contains same characters, only the order of characters can be different. For example, “act” and “tac” are anagram of each other. Invest your time to study the locked code and complete it accordingly.

Input:
The first line contains the number of test cases, each test case consists of one line input containing 2 space separated strings representing the first and last name of the student.

Output:
For each test case T, the output should consist of a single line - ANAGRAM or NOT ANAGRAM depending upon if the 2 given strings are anagram of each other or not.

Constraints:
1 <= T <= 100

Example:
Input:

2
rahul garg 
ankit kitan

Output:
NOT ANAGRAM
ANAGRAM

2.

Stuti is a very good dancer. She is preparing for her performance at her college fest. But unfortunately she has to submit her maths assignment just before the college fest. She has completed most of the problems but she is stuck at one. She has no clue how to solve this problem. Now she is in a dilemma of whether to prepare for her performance or try to solve that problem. She is very tensed. She needs your help to solve this problem.

Problem contains a number N(1<= N <= 1000000000). If this number is the sum of first 's' natural number then print 's' otherwise print -1.

INPUT

First line denotes the number of test cases(1<= T <= 100).

And next T lines contains a single integer.

 

OUTPUT

For each test case print a single integer in next line.

3.

Given a priority queue (max heap) and Q queries to be performed on priority queue. The task is to perform operations based on queries.
1. p : query to push element (x, given with query) to priority_queue and print size.
2. pp : query to pop element from priority_queue and print size.
3. t : query to return top element of priority_queue, if empty -1 will be printed.

Input Format:
First line of input contains number of testcases T. For each testcase, first line of input contains Q queries. Next Q lines contains Q queries.

Output Format:
For each testcase, perform the required operation, and print if anything required.

Your Task:
Your task is to complete the functions push_pq(), pp_pq() and pq_top(), so that the queries are performed.

Constraints:
1 <= T <= 100
1 <= Q <= 100

Example:
Input:

1
5
p 5
p 3
p 1
t
pp
Output:
1
2
3
1
2