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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: D = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: D = None
        self.v: D = None
        self.txt = txt

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

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

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

b.s = f
b.o = e
h.v = f
h.s = f
h.y = m
m.y = h
m.s = e
m.v = e
f.y = m
a.q = m
a.w = m
a.x = j
e.y = m
j.q = m
j.w = m
j.x = a
l.y = m
assert h.s.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: D = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: D = None
        self.v: D = None
        self.txt = txt

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

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

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

b.s = f
b.o = e
h.v = f
h.s = f
h.y = m
m.y = h
m.s = e
m.v = e
f.y = m
a.q = m
a.w = m
a.x = j
e.y = m
j.q = m
j.w = m
j.x = a
l.y = m
assert h.s.y.y.txt == "h"