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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: D = None
        self.p: C = None
        self.o: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

e.w = f
e.t = j
e.r = m
b.x = f
b.z = f
b.r = m
b.p = j
b.o = j
j.w = m
j.y = m
j.r = b
j.o = e
j.q = e
m.r = f
m.o = j
f.v = j
assert j.y.o.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: C = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: D = None
        self.p: C = None
        self.o: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

e.w = f
e.t = j
e.r = m
b.x = f
b.z = f
b.r = m
b.p = j
b.o = j
j.w = m
j.y = m
j.r = b
j.o = e
j.q = e
m.r = f
m.o = j
f.v = j
assert j.y.o.w.r.txt == "f"