I'm not very familiar with python, therefore I will only explain how to do:
In order to iterate through a dictionary, you must have a list/array, which provides all the keys of the dictionary in right order. In youe example:
trial[] = {a, b, c, d} and trial2[] = {r, t, u, j}
At the time you're filling the dictionary also save the key in the array/list.
The dictionary (in my understanding) is like a hashtable and therefore has a really short access time. (Probably I am wrong, but then you habe to accept a long runtime)
Then iterate through both key-arrays and search for the values in the dictionaries and do whatever you want.
In case, you haven't initialized the dictionary yourself (what I think should not be the case, as no one would type dicrionary entries in an constructor/method) then you have to iterate through the second dictionary and get all the keys afterwards in your array/list.
Then iterate through the dictionary1 and through the array/list with the keys and search the value in dictionary2 with the current key at array/list index.
Just ask if you don't get it, probably I should write code, maybe later, when I'm awake...