XOR Cipher
Submissions: 1216   Accuracy:

17.79%

  Difficulty: Easy   Marks: 2

Kshitij and Abhishek are best friends. Kshitij changed Abhishek's all accounts password and gave him a string s created by a cipher algorithm. Being good at bit algorithm, he XORed the hexadecimal string, N number of times, where N is the string length and every XOR operation is done after shifting the consecutive string to the right.
For example : String="abcd".

Abhishek finds it difficult in understanding how it is done. But you are now clever enough to find out the original password, so help him.

Input:
The first line contains an integer T, the number of test cases. For each test case, there is a hexadecimal string s. 

Output:
For each test case, the output is a string containing the original password.

Constraints:
1<=T<=100
1<=N<=1001 & N%2=1
Note: Alphabets are in uppercase.

Example:
Input

2
A1D0A1D
653CAE8DA8EDB426052
Output
ABCD
636F646572

 

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Vanshika Sharma
Author: Vanshika_pec


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.