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

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

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

d = A("d")
f = B("f")
l = C("l")
c = C("c")
j = A("j")
m = B("m")
n = B("n")
e = A("e")

d.z = l
d.q = j
d.y = n
f.x = c
f.o = l
f.u = l
l.s = m
l.w = c
l.p = n
c.s = f
c.w = l
c.p = m
j.z = l
j.q = d
j.y = m
m.x = l
m.o = l
m.u = l
n.x = l
n.o = l
n.u = c
e.z = c
e.q = j
e.y = n
assert f.u.s.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: A = None
        self.y: B = None
        self.txt = txt

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

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

d = A("d")
f = B("f")
l = C("l")
c = C("c")
j = A("j")
m = B("m")
n = B("n")
e = A("e")

d.z = l
d.q = j
d.y = n
f.x = c
f.o = l
f.u = l
l.s = m
l.w = c
l.p = n
c.s = f
c.w = l
c.p = m
j.z = l
j.q = d
j.y = m
m.x = l
m.o = l
m.u = l
n.x = l
n.o = l
n.u = c
e.z = c
e.q = j
e.y = n
assert f.u.s.u.w.txt == "c"