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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: D = None
        self.txt = txt

b = A("b")
d = B("d")
g = C("g")
a = D("a")
k = E("k")
c = E("c")
e = E("e")
m = C("m")
i = D("i")

b.x = k
b.t = e
b.z = d
b.w = i
b.u = i
d.t = c
g.p = k
a.q = b
a.r = g
a.v = i
a.o = k
k.w = d
k.s = a
c.w = d
c.s = a
e.w = d
e.s = i
m.p = c
i.q = b
i.r = m
i.v = a
i.o = e
assert d.t.w.t.w.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.z: B = None
        self.w: D = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: D = None
        self.txt = txt

b = A("b")
d = B("d")
g = C("g")
a = D("a")
k = E("k")
c = E("c")
e = E("e")
m = C("m")
i = D("i")

b.x = k
b.t = e
b.z = d
b.w = i
b.u = i
d.t = c
g.p = k
a.q = b
a.r = g
a.v = i
a.o = k
k.w = d
k.s = a
c.w = d
c.s = a
e.w = d
e.s = i
m.p = c
i.q = b
i.r = m
i.v = a
i.o = e
assert d.t.w.t.w.t.s.txt == "a"