class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: B = None
        self.t: E = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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