class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: D = None
        self.w: B = None
        self.q: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: C = None
        self.s: C = None
        self.r: B = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: C = None
        self.s: C = None
        self.r: B = None
        self.t: B = None
        self.txt = txt

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

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