class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: B = None
        self.v: D = None
        self.s: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

e.y = j
e.r = j
e.s = j
e.v = h
j.y = b
j.s = b
j.x = b
j.t = h
j.q = e
b.w = h
b.t = c
h.w = j
c.q = b
c.y = j
c.s = h
assert c.y.t.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: B = None
        self.v: D = None
        self.s: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

e.y = j
e.r = j
e.s = j
e.v = h
j.y = b
j.s = b
j.x = b
j.t = h
j.q = e
b.w = h
b.t = c
h.w = j
c.q = b
c.y = j
c.s = h
assert c.y.t.w.q.txt == "e"