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

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

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

d = A("d")
g = B("g")
k = C("k")
m = B("m")
e = B("e")
a = A("a")
l = C("l")
h = A("h")
n = A("n")

d.z = l
g.u = n
g.y = l
g.v = a
k.q = n
k.u = l
k.y = l
m.u = d
m.v = d
m.y = l
e.u = h
e.y = k
e.v = a
a.z = k
l.q = h
l.u = k
l.y = k
h.z = l
n.z = l
assert e.v.z.y.u.y.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

d = A("d")
g = B("g")
k = C("k")
m = B("m")
e = B("e")
a = A("a")
l = C("l")
h = A("h")
n = A("n")

d.z = l
g.u = n
g.y = l
g.v = a
k.q = n
k.u = l
k.y = l
m.u = d
m.v = d
m.y = l
e.u = h
e.y = k
e.v = a
a.z = k
l.q = h
l.u = k
l.y = k
h.z = l
n.z = l
assert e.v.z.y.u.y.u.y.txt == "l"