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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: E = None
        self.w: C = None
        self.y: D = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: A = None
        self.z: C = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: B = None
        self.t: D = None
        self.s: D = None
        self.txt = txt

e = A("e")
i = B("i")
m = C("m")
h = D("h")
n = E("n")
f = F("f")
l = D("l")
b = C("b")

e.u = n
e.w = m
i.u = f
i.z = n
i.p = n
i.w = b
i.y = l
m.s = e
m.w = e
m.z = b
m.u = h
h.o = e
h.r = e
n.t = f
f.y = e
f.x = i
f.t = l
f.s = h
l.o = e
l.r = e
b.s = e
b.w = e
b.z = m
b.u = h
assert m.u.o.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: E = None
        self.w: C = None
        self.y: D = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: A = None
        self.z: C = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: B = None
        self.t: D = None
        self.s: D = None
        self.txt = txt

e = A("e")
i = B("i")
m = C("m")
h = D("h")
n = E("n")
f = F("f")
l = D("l")
b = C("b")

e.u = n
e.w = m
i.u = f
i.z = n
i.p = n
i.w = b
i.y = l
m.s = e
m.w = e
m.z = b
m.u = h
h.o = e
h.r = e
n.t = f
f.y = e
f.x = i
f.t = l
f.s = h
l.o = e
l.r = e
b.s = e
b.w = e
b.z = m
b.u = h
assert m.u.o.w.u.txt == "h"