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

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

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

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

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

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

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

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

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

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

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

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

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