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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: A = None
        self.txt = txt

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

a = A("a")
l = B("l")
m = C("m")
n = B("n")
e = A("e")
j = B("j")

a.u = e
a.t = l
l.r = a
l.v = a
m.q = j
n.r = e
n.v = a
e.u = a
e.t = l
j.r = a
j.v = a
assert a.u.t.r.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: A = None
        self.txt = txt

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

a = A("a")
l = B("l")
m = C("m")
n = B("n")
e = A("e")
j = B("j")

a.u = e
a.t = l
l.r = a
l.v = a
m.q = j
n.r = e
n.v = a
e.u = a
e.t = l
j.r = a
j.v = a
assert a.u.t.r.u.u.txt == "a"