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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: C = None
        self.x: C = None
        self.u: D = None
        self.txt = txt

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

k = A("k")
a = B("a")
d = C("d")
e = D("e")
g = C("g")
i = B("i")
c = A("c")
h = B("h")
n = B("n")

k.q = g
a.w = g
a.z = g
a.o = c
d.p = e
d.u = e
d.w = g
d.x = g
e.u = c
g.p = e
g.u = e
g.w = d
g.x = d
i.w = g
i.o = c
i.z = d
c.q = d
h.w = g
h.o = k
h.z = d
n.w = g
n.z = g
n.o = k
assert n.w.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: C = None
        self.x: C = None
        self.u: D = None
        self.txt = txt

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

k = A("k")
a = B("a")
d = C("d")
e = D("e")
g = C("g")
i = B("i")
c = A("c")
h = B("h")
n = B("n")

k.q = g
a.w = g
a.z = g
a.o = c
d.p = e
d.u = e
d.w = g
d.x = g
e.u = c
g.p = e
g.u = e
g.w = d
g.x = d
i.w = g
i.o = c
i.z = d
c.q = d
h.w = g
h.o = k
h.z = d
n.w = g
n.z = g
n.o = k
assert n.w.u.u.txt == "c"