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

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

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

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

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

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

b.s = i
b.o = d
b.w = f
j.p = d
j.v = h
j.s = n
h.x = n
f.q = i
f.p = j
f.z = m
f.u = e
d.y = i
i.q = e
i.p = j
i.z = d
i.u = f
m.y = e
n.s = f
n.o = m
n.w = i
e.q = f
e.u = f
e.p = j
e.z = m
assert j.v.x.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: E = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

b.s = i
b.o = d
b.w = f
j.p = d
j.v = h
j.s = n
h.x = n
f.q = i
f.p = j
f.z = m
f.u = e
d.y = i
i.q = e
i.p = j
i.z = d
i.u = f
m.y = e
n.s = f
n.o = m
n.w = i
e.q = f
e.u = f
e.p = j
e.z = m
assert j.v.x.w.u.txt == "f"