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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: C = None
        self.u: E = None
        self.r: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: C = None
        self.u: E = None
        self.r: D = None
        self.txt = txt

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

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

e.t = j
e.p = h
e.w = c
c.t = n
j.z = c
j.v = n
h.x = e
h.q = j
h.u = n
h.r = k
n.s = e
n.x = c
k.x = e
k.q = j
k.u = n
k.r = h
assert h.x.t.v.x.txt == "c"