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

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

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

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

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

k = A("k")
g = B("g")
i = C("i")
d = D("d")
m = E("m")
h = E("h")
j = B("j")
e = D("e")

k.u = i
k.t = h
g.t = h
g.o = h
i.y = h
i.u = j
d.w = j
m.y = e
m.v = e
m.t = h
m.u = g
h.y = d
h.v = d
h.t = m
h.u = g
j.t = h
j.o = h
e.w = g
assert m.y.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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

k = A("k")
g = B("g")
i = C("i")
d = D("d")
m = E("m")
h = E("h")
j = B("j")
e = D("e")

k.u = i
k.t = h
g.t = h
g.o = h
i.y = h
i.u = j
d.w = j
m.y = e
m.v = e
m.t = h
m.u = g
h.y = d
h.v = d
h.t = m
h.u = g
j.t = h
j.o = h
e.w = g
assert m.y.w.t.txt == "h"