Chef has some numbers. His girlfriend Chefina feels good when chef gives her a particular pattern number also called as Armstrong number.
Armstrong number is a number whose sum of its all individual digit raise to the power of the number of digit in that number is equal to that number itself
eg.. 153 = 1^3 + 5^3 + 3^3 (153 is an Armstrong number)
1634 = 1^4 + 6^4 + 3^4 + 4^4 (1634 is an Armstrong number)
As a love guru of chef you have to help chef to find Armstrong numbers Among the numbers which chef has initially so that Chefina feels good

-----Input:-----
First line will contain a positive Integer $T$ which is the number of testcases
Next $T$ lines follows an Integer $N$.

-----Output:-----
For Every n You have to print "FEELS GOOD" without qoutes if it is an armstrong number otherwise Print "FEELS BAD" without quotes

-----Constraints-----
- $1 \leq T \leq 10$
- $2 \leq N \leq 10^6$

-----Sample Input:-----
3
153
11
1634

-----Sample Output:-----
FEELS GOOD
FEELS BAD
FEELS GOOD

-----EXPLANATION:-----
For test case 1 --> 153 = 1^3 + 5^3 + 3^3 (153 is an armstrong number)

Source: codechef | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
def power(x, y):
	if y == 0:
		return 1
	if y % 2 == 0:
		return power(x, y // 2) * power(x, y // 2)
	return x * power(x, y // 2) * power(x, y // 2)

def order(x):
	n = 0
	while x != 0:
		n = n + 1
		x = x // 10
	return n

def isArmstrong(x):
	n = order(x)
	temp = x
	sum1 = 0
	while temp != 0:
		r = temp % 10
		sum1 = sum1 + power(r, n)
		temp = temp // 10
	return sum1 == x
for _ in range(int(input())):
	num = int(input())
	if isArmstrong(num):
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


t = int(input())

def dig(a):
	c = 0
	i = a
	while i > 0:
		c = c + 1
		i = i // 10
	return c

def sums(a, b):
	s = 0
	i = a
	while i > 0:
		s = s + pow(i % 10, b)
		i = i // 10
	return s
for i in range(t):
	a = int(input())
	b = dig(a)
	if int(sums(a, b)) == a:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


t = int(input())
for i in range(t):
	n = int(input())
	p = len(str(n))
	s = 0
	k = n
	while k > 0:
		d = k % 10
		s = s + d ** p
		k = k // 10
	if n == s:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


t = int(input())
for i in range(1, t + 1):
	num = int(input())
	n = str(num)
	sum = 0
	temp = num
	while temp > 0:
		dg = temp % 10
		sum += dg ** len(n)
		temp //= 10
	if num == sum:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


T = int(input())
while T > 0:
	Out = 0
	summ = 0
	Res = 0
	N = int(input())
	M = N
	leng = len(str(N))
	for i in range(0, leng):
		Res = N % 10
		Out = pow(Res, leng)
		summ = summ + Out
		N = N // 10
	if summ == M:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')
	T = T - 1


for _ in range(int(input())):
	n = int(input())
	x = len(str(n))
	(t, s) = (n, 0)
	while n:
		s += (n % 10) ** x
		n //= 10
	if t == s:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


for _ in range(int(input())):
	num = int(input())
	s = 0
	temp = num
	while temp > 0:
		digit = temp % 10
		s += digit ** len(str(num))
		temp //= 10
	if num == s:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


for nt in range(int(input())):
	num = int(input())
	sum = 0
	temp = num
	r = len(str(num))
	while temp > 0:
		digit = temp % 10
		sum += digit ** r
		temp //= 10
	if num == sum:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


import math
for _ in range(int(input())):
	N = int(input())
	D = math.floor(math.log(N, 10)) + 1
	T = N
	R = 0
	while T > 0:
		M = T % 10
		T = T // 10
		R += pow(M, D)
	if R == N:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


def arm(n):
	sum = 0
	l = len(str(n))
	m = n
	while n != 0:
		sum += (n % 10) ** l
		n //= 10
	if sum == m:
		return 'FEELS GOOD'
	else:
		return 'FEELS BAD'
t = int(input())
l = []
for i in range(t):
	l.append(arm(int(input())))
for i in l:
	print(i)


N = int(input())
for i in range(N):
	i = int(input())
	x = i % 10
	add = 0
	z = 0
	temp = i
	while temp != 0:
		temp //= 10
		z += 1
	temp = i
	for j in range(z):
		temp = temp // 10
		add += x ** z
		x = temp % 10
	if add == i:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


tc = int(input())
for i in range(tc):
	n = int(input())
	m = str(n)
	length = len(m)
	m = [int(i) for i in m]
	sum = 0
	for j in m:
		sum += j ** length
	if sum == n:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


for i in range(int(input())):
	n = int(input())
	sum = 0
	t = n
	while t > 0:
		digit = t % 10
		sum += digit ** len(str(n))
		t //= 10
	if n == sum:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


n = int(input())
for i in range(n):
	m = int(input())
	l = list(map(int, str(m)))
	sum = 0
	for j in range(len(l)):
		sum = sum + pow(l[j], len(l))
	if sum == m:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


for _ in range(int(input())):
	n = int(input())
	k = n
	s = str(n)
	l = len(s)
	su = 0
	while k != 0:
		su += (k % 10) ** l
		k = k // 10
	if su == n:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


t = int(input())
for _ in range(t):
	x = int(input())
	l = len(str(x))
	sum = 0
	for i in str(x):
		sum = sum + int(i) ** int(l)
	if sum == x:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


t = int(input())
for w in range(t):
	n = int(input())
	m = n
	sm = digit = 0
	while n > 0:
		n = n // 10
		digit += 1
	n = m
	while m > 0:
		a = m % 10
		sm = sm + a ** digit
		m = m // 10
	if n == sm:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


def check(n):
	s = str(n)
	l = len(s)
	add = 0
	for i in range(l):
		add = add + int(s[i]) ** l
	if add == n:
		return 1
	else:
		return 0

def __starting_point():
	for _ in range(int(input())):
		n = int(input())
		if check(n):
			print('FEELS GOOD')
		else:
			print('FEELS BAD')
__starting_point()


for _ in range(int(input())):
	num = int(input())
	num_original = num2 = num
	sum1 = 0
	cnt = 0
	while num > 0:
		cnt = cnt + 1
		num = num // 10
	while num2 > 0:
		rem = num2 % 10
		sum1 += rem ** cnt
		num2 //= 10
	if num_original == sum1:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


for a0 in range(int(input())):
	n = int(input())
	l = list(str(n))
	q = len(l)
	s = 0
	for i in l:
		s += int(i) ** q
	if s == n:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')


t = int(input())
for i in range(0, t):
	num = int(input())
	order = len(str(num))
	sum = 0
	temp = num
	while temp > 0:
		digit = temp % 10
		sum += digit ** order
		temp //= 10
	if num == sum:
		print('FEELS GOOD')
	else:
		print('FEELS BAD')