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

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

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

l = A("l")
a = B("a")
d = C("d")
i = B("i")
e = B("e")
c = A("c")
b = A("b")
n = A("n")
m = C("m")

l.t = n
l.r = n
a.t = m
a.u = m
a.r = i
d.z = m
d.w = l
d.v = i
i.t = m
i.u = m
i.r = a
e.t = d
e.u = d
e.r = i
c.t = l
c.r = l
b.t = l
b.r = n
n.t = c
n.r = l
m.z = d
m.w = n
m.v = a
assert e.r.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: A = None
        self.txt = txt

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

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

l = A("l")
a = B("a")
d = C("d")
i = B("i")
e = B("e")
c = A("c")
b = A("b")
n = A("n")
m = C("m")

l.t = n
l.r = n
a.t = m
a.u = m
a.r = i
d.z = m
d.w = l
d.v = i
i.t = m
i.u = m
i.r = a
e.t = d
e.u = d
e.r = i
c.t = l
c.r = l
b.t = l
b.r = n
n.t = c
n.r = l
m.z = d
m.w = n
m.v = a
assert e.r.u.v.txt == "a"