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

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

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

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

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

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

k.y = b
k.r = j
e.v = j
j.s = f
f.p = j
f.r = j
f.s = b
f.q = e
f.z = k
b.z = k
b.w = k
b.r = j
h.z = k
h.w = k
h.r = j
assert f.z.r.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

k.y = b
k.r = j
e.v = j
j.s = f
f.p = j
f.r = j
f.s = b
f.q = e
f.z = k
b.z = k
b.w = k
b.r = j
h.z = k
h.w = k
h.r = j
assert f.z.r.s.txt == "f"