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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

h.u = d
h.v = k
k.z = j
k.o = h
k.s = h
k.q = h
k.x = d
f.w = l
f.p = c
f.q = n
f.x = d
d.x = h
d.v = h
l.o = h
i.x = h
i.v = h
j.z = k
j.o = h
j.s = h
j.q = h
j.x = d
c.z = j
c.o = h
c.s = h
c.q = h
c.x = i
n.o = h
assert d.x.v.x.v.u.x.v.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

h.u = d
h.v = k
k.z = j
k.o = h
k.s = h
k.q = h
k.x = d
f.w = l
f.p = c
f.q = n
f.x = d
d.x = h
d.v = h
l.o = h
i.x = h
i.v = h
j.z = k
j.o = h
j.s = h
j.q = h
j.x = d
c.z = j
c.o = h
c.s = h
c.q = h
c.x = i
n.o = h
assert d.x.v.x.v.u.x.v.x.v.txt == "h"