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

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

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

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

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

j = A("j")
m = B("m")
e = C("e")
g = D("g")
h = E("h")
b = A("b")
c = A("c")
f = C("f")
a = B("a")

j.z = h
j.o = h
j.w = b
m.u = h
e.w = f
g.u = e
g.t = e
g.y = m
g.z = a
h.z = g
b.z = h
b.o = h
b.w = j
c.z = h
c.o = h
c.w = b
f.w = e
a.u = h
assert h.z.y.u.z.t.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: A = None
        self.o: E = None
        self.txt = txt

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

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

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

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

j = A("j")
m = B("m")
e = C("e")
g = D("g")
h = E("h")
b = A("b")
c = A("c")
f = C("f")
a = B("a")

j.z = h
j.o = h
j.w = b
m.u = h
e.w = f
g.u = e
g.t = e
g.y = m
g.z = a
h.z = g
b.z = h
b.o = h
b.w = j
c.z = h
c.o = h
c.w = b
f.w = e
a.u = h
assert h.z.y.u.z.t.w.w.txt == "e"