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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: D = None
        self.s: B = None
        self.o: D = None
        self.r: A = None
        self.txt = txt

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

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

d = A("d")
f = B("f")
g = C("g")
c = D("c")
j = E("j")
m = A("m")
a = D("a")
h = B("h")
k = D("k")

d.t = a
d.z = c
d.u = j
d.x = m
f.t = a
f.u = a
g.q = m
g.y = a
g.s = f
g.o = k
g.r = d
c.o = j
c.u = j
c.r = d
c.z = m
c.v = g
j.w = d
m.t = k
m.z = k
m.u = j
m.x = d
a.o = j
a.u = j
a.r = d
a.z = d
a.v = g
h.t = k
h.u = c
k.o = j
k.u = j
k.r = m
k.z = d
k.v = g
assert d.u.w.t.v.s.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: D = None
        self.u: E = None
        self.x: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: D = None
        self.s: B = None
        self.o: D = None
        self.r: A = None
        self.txt = txt

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

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

d = A("d")
f = B("f")
g = C("g")
c = D("c")
j = E("j")
m = A("m")
a = D("a")
h = B("h")
k = D("k")

d.t = a
d.z = c
d.u = j
d.x = m
f.t = a
f.u = a
g.q = m
g.y = a
g.s = f
g.o = k
g.r = d
c.o = j
c.u = j
c.r = d
c.z = m
c.v = g
j.w = d
m.t = k
m.z = k
m.u = j
m.x = d
a.o = j
a.u = j
a.r = d
a.z = d
a.v = g
h.t = k
h.u = c
k.o = j
k.u = j
k.r = m
k.z = d
k.v = g
assert d.u.w.t.v.s.t.u.txt == "j"