This is a fun little riddle, coming from a discussion with Dan Johnson. At t2 Mary believes q because she believes p. At t1 (t1<t2), she had come to believe p because she had believed q. No new evidence came in after t1 for p. Yet her beliefs that p and q are both justified and, indeed, knowledge. How could this be?
One solution: p and q are mathematical theorems. At t0 (t0<t1), Mary saw a proof of q. At t1, she saw that p easily follows from q. Between t1 and t2, Mary forgot all about q, the proof of q, and the fact that she derived p from q. She continued to know p, since we know mathematical theorems that we once had known the proofs of even if we do not remember these proofs. At t2, Mary realized that q easily follows from p, and came to believe q. Since she knew p, she now has knowledge of q.
Comments: This appears to involve a circularity in the order of justification, but only if we confuse the contents of beliefs with believings (or types of belief with belief tokens). Mary has three relevant, believings: (1) her believing between t0 until after t1 that q, (2) her believing starting at t1 that p, and (3) her new believing that q starting at t2. Here, (1) has independent justification; the justification of (2) depends on the justification of (1); the justification of (3) depends on the justification of (2). There is no real circularity.