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

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

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

n = A("n")
l = B("l")
k = C("k")
f = A("f")
m = B("m")
j = B("j")
g = A("g")
e = B("e")
d = A("d")
i = B("i")

n.x = g
n.o = m
n.z = j
l.u = f
k.p = i
k.x = n
k.o = e
f.x = d
f.o = l
f.z = e
m.u = d
j.u = g
g.x = d
g.o = j
g.z = m
e.u = d
d.x = n
d.o = m
d.z = e
i.u = g
assert d.z.u.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: B = None
        self.z: B = None
        self.txt = txt

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

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

n = A("n")
l = B("l")
k = C("k")
f = A("f")
m = B("m")
j = B("j")
g = A("g")
e = B("e")
d = A("d")
i = B("i")

n.x = g
n.o = m
n.z = j
l.u = f
k.p = i
k.x = n
k.o = e
f.x = d
f.o = l
f.z = e
m.u = d
j.u = g
g.x = d
g.o = j
g.z = m
e.u = d
d.x = n
d.o = m
d.z = e
i.u = g
assert d.z.u.o.u.txt == "d"