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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: E = None
        self.s: B = None
        self.t: B = None
        self.o: B = None
        self.txt = txt

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

d = A("d")
k = B("k")
b = C("b")
c = D("c")
j = E("j")

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: E = None
        self.s: B = None
        self.t: B = None
        self.o: B = None
        self.txt = txt

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

d = A("d")
k = B("k")
b = C("b")
c = D("c")
j = E("j")

d.u = j
d.t = c
k.w = b
k.t = b
k.q = d
k.u = d
b.z = c
b.v = j
b.s = j
b.u = k
c.q = j
c.x = j
c.s = k
c.t = k
c.o = k
j.r = d
j.t = d
j.u = b
j.o = b
j.y = k
assert c.q.o.u.txt == "k"