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

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

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

b = A("b")
m = B("m")
g = C("g")
l = B("l")
k = C("k")
c = A("c")
j = B("j")
n = B("n")
a = B("a")
e = B("e")

b.v = l
b.w = k
m.y = k
m.x = g
g.z = m
g.y = k
l.y = g
l.x = g
k.z = j
k.y = g
c.v = e
c.w = g
j.y = g
j.x = g
n.y = k
n.x = k
a.y = g
a.x = k
e.y = k
e.x = k
assert l.x.y.z.x.z.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: C = None
        self.txt = txt

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

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

b = A("b")
m = B("m")
g = C("g")
l = B("l")
k = C("k")
c = A("c")
j = B("j")
n = B("n")
a = B("a")
e = B("e")

b.v = l
b.w = k
m.y = k
m.x = g
g.z = m
g.y = k
l.y = g
l.x = g
k.z = j
k.y = g
c.v = e
c.w = g
j.y = g
j.x = g
n.y = k
n.x = k
a.y = g
a.x = k
e.y = k
e.x = k
assert l.x.y.z.x.z.y.z.txt == "j"