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

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

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

class D:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: B = None
        self.r: B = None
        self.txt = txt

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

h = A("h")
b = B("b")
l = C("l")
g = D("g")
k = E("k")
d = D("d")
c = C("c")
f = E("f")
n = B("n")

h.q = l
h.z = k
h.u = n
b.y = h
b.u = h
b.w = h
b.v = n
b.x = n
l.u = c
l.y = b
l.w = n
l.z = h
l.o = g
g.z = d
g.q = b
g.r = n
k.y = n
k.z = f
k.t = f
d.z = g
d.q = b
d.r = n
c.u = l
c.y = n
c.w = n
c.z = h
c.o = d
f.y = b
f.z = k
f.t = k
n.y = h
n.u = h
n.w = h
n.v = b
n.x = b
assert c.o.z.z.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: E = None
        self.u: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: B = None
        self.r: B = None
        self.txt = txt

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

h = A("h")
b = B("b")
l = C("l")
g = D("g")
k = E("k")
d = D("d")
c = C("c")
f = E("f")
n = B("n")

h.q = l
h.z = k
h.u = n
b.y = h
b.u = h
b.w = h
b.v = n
b.x = n
l.u = c
l.y = b
l.w = n
l.z = h
l.o = g
g.z = d
g.q = b
g.r = n
k.y = n
k.z = f
k.t = f
d.z = g
d.q = b
d.r = n
c.u = l
c.y = n
c.w = n
c.z = h
c.o = d
f.y = b
f.z = k
f.t = k
n.y = h
n.u = h
n.w = h
n.v = b
n.x = b
assert c.o.z.z.q.x.txt == "n"