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

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

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

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

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

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

m.t = b
m.x = k
j.o = k
d.u = f
d.x = f
d.v = h
d.w = h
d.o = m
f.z = b
f.s = b
f.t = k
f.v = k
f.o = k
k.z = n
c.u = f
c.x = f
c.v = m
c.w = m
c.o = h
n.u = f
n.x = f
n.v = h
n.w = h
n.o = m
h.t = b
h.x = k
b.o = k
assert m.x.z.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

m.t = b
m.x = k
j.o = k
d.u = f
d.x = f
d.v = h
d.w = h
d.o = m
f.z = b
f.s = b
f.t = k
f.v = k
f.o = k
k.z = n
c.u = f
c.x = f
c.v = m
c.w = m
c.o = h
n.u = f
n.x = f
n.v = h
n.w = h
n.o = m
h.t = b
h.x = k
b.o = k
assert m.x.z.v.t.txt == "b"