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

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

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

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

l.v = m
l.z = m
l.u = m
m.y = a
m.u = k
m.o = b
d.s = m
d.p = a
e.v = m
e.z = m
e.u = m
b.v = m
b.z = m
b.u = m
a.s = m
a.p = k
k.s = m
k.p = a
h.v = m
h.z = m
h.u = m
assert d.p.p.p.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: B = None
        self.u: B = None
        self.txt = txt

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

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

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

l.v = m
l.z = m
l.u = m
m.y = a
m.u = k
m.o = b
d.s = m
d.p = a
e.v = m
e.z = m
e.u = m
b.v = m
b.z = m
b.u = m
a.s = m
a.p = k
k.s = m
k.p = a
h.v = m
h.z = m
h.u = m
assert d.p.p.p.s.y.txt == "a"