|All-time Popular Problems|
|Detect cycle in an undirected graph|
|BFS traversal of graph|
|Two Mirror Trees|
|Delete nodes having greater value on right|
|Find the number of islands|
|Sum of all prime numbers between 1 and N.|
|Determine if Two Trees are Identical|
|Longest Palindrome in a String|
Write a program that calculates the day of the week for any particular date in the past or future.
The first line of input contains a single integer T denoting the number of test cases. Then T test cases follow. Each test case consist of one line. The first line of each test case consists of an integer d,m and y, d is day, m is month and y is the year.
Print day of given date.
1 ≤ T ≤ 100
1990 ≤ Y ≤ 2100
28 12 1995
30 8 2010