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

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

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

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

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

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

k.t = l
k.v = l
k.u = l
k.w = b
h.p = l
h.o = l
h.q = j
h.w = j
j.z = b
j.p = h
l.y = h
l.u = j
b.r = k
b.t = k
assert j.p.w.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: D = None
        self.w: E = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

k.t = l
k.v = l
k.u = l
k.w = b
h.p = l
h.o = l
h.q = j
h.w = j
j.z = b
j.p = h
l.y = h
l.u = j
b.r = k
b.t = k
assert j.p.w.z.t.txt == "k"