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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: D = None
        self.o: A = None
        self.z: C = None
        self.r: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: C = None
        self.z: E = None
        self.u: A = None
        self.txt = txt

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

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

h.t = g
h.u = i
l.u = m
l.q = f
g.u = d
g.q = d
g.o = h
g.z = f
g.r = f
b.r = h
b.u = h
b.s = f
b.z = i
i.z = h
i.p = h
i.x = b
i.q = f
n.r = h
n.u = h
n.s = g
n.z = i
m.r = h
m.u = h
m.s = g
m.z = i
f.u = d
f.q = n
f.o = h
f.z = g
f.r = g
d.r = h
d.u = h
d.s = g
d.z = i
assert d.u.t.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: D = None
        self.o: A = None
        self.z: C = None
        self.r: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: C = None
        self.z: E = None
        self.u: A = None
        self.txt = txt

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

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

h.t = g
h.u = i
l.u = m
l.q = f
g.u = d
g.q = d
g.o = h
g.z = f
g.r = f
b.r = h
b.u = h
b.s = f
b.z = i
i.z = h
i.p = h
i.x = b
i.q = f
n.r = h
n.u = h
n.s = g
n.z = i
m.r = h
m.u = h
m.s = g
m.z = i
f.u = d
f.q = n
f.o = h
f.z = g
f.r = g
d.r = h
d.u = h
d.s = g
d.z = i
assert d.u.t.u.s.txt == "g"