class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: C = None
        self.t: A = None
        self.txt = txt

b = A("b")
f = B("f")
c = C("c")
k = B("k")
a = C("a")
n = A("n")
l = C("l")
d = B("d")
j = A("j")
g = A("g")

b.u = a
f.q = d
c.v = j
c.q = l
c.t = n
k.q = d
a.v = g
a.t = g
a.q = c
n.u = c
l.v = n
l.q = c
l.t = g
d.q = k
j.u = a
g.u = a
assert a.t.u.q.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: C = None
        self.t: A = None
        self.txt = txt

b = A("b")
f = B("f")
c = C("c")
k = B("k")
a = C("a")
n = A("n")
l = C("l")
d = B("d")
j = A("j")
g = A("g")

b.u = a
f.q = d
c.v = j
c.q = l
c.t = n
k.q = d
a.v = g
a.t = g
a.q = c
n.u = c
l.v = n
l.q = c
l.t = g
d.q = k
j.u = a
g.u = a
assert a.t.u.q.t.u.txt == "c"