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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: D = None
        self.o: C = None
        self.v: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: D = None
        self.u: B = None
        self.r: E = None
        self.txt = txt

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

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

k = A("k")
i = B("i")
f = C("f")
a = D("a")
m = E("m")
e = A("e")

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: D = None
        self.o: C = None
        self.v: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: D = None
        self.u: B = None
        self.r: E = None
        self.txt = txt

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

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

k = A("k")
i = B("i")
f = C("f")
a = D("a")
m = E("m")
e = A("e")

k.t = m
k.w = i
k.q = a
i.x = k
i.w = a
i.v = a
i.p = a
i.o = f
f.x = m
f.r = m
f.v = a
f.u = i
a.v = i
a.x = i
a.o = i
m.w = f
m.z = f
m.t = e
m.u = i
e.t = m
e.w = i
e.q = a
assert m.u.w.v.o.x.txt == "m"