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

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

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

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

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

m = A("m")
n = B("n")
d = C("d")
j = D("j")
k = E("k")
b = A("b")
h = E("h")
e = A("e")

m.s = e
m.x = n
m.o = d
m.y = d
m.w = j
n.x = j
n.s = j
n.y = b
n.t = e
n.z = m
d.s = n
j.w = e
j.y = d
k.p = j
k.r = j
b.s = m
b.x = n
b.o = d
b.y = d
b.w = j
h.p = j
h.r = j
e.s = m
e.x = n
e.o = d
e.y = d
e.w = j
assert b.w.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: B = None
        self.o: C = None
        self.w: D = None
        self.y: C = None
        self.txt = txt

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

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

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

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

m = A("m")
n = B("n")
d = C("d")
j = D("j")
k = E("k")
b = A("b")
h = E("h")
e = A("e")

m.s = e
m.x = n
m.o = d
m.y = d
m.w = j
n.x = j
n.s = j
n.y = b
n.t = e
n.z = m
d.s = n
j.w = e
j.y = d
k.p = j
k.r = j
b.s = m
b.x = n
b.o = d
b.y = d
b.w = j
h.p = j
h.r = j
e.s = m
e.x = n
e.o = d
e.y = d
e.w = j
assert b.w.y.s.txt == "n"