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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: E = None
        self.q: B = None
        self.x: A = None
        self.w: A = None
        self.txt = txt

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

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

b = A("b")
j = B("j")
i = C("i")
n = D("n")
a = E("a")
k = A("k")

b.y = n
b.t = n
b.v = k
b.z = i
j.q = n
i.z = k
i.y = a
i.q = j
i.x = b
i.w = b
n.q = i
n.x = j
n.s = a
n.y = k
a.y = n
k.y = n
k.t = n
k.v = b
k.z = i
assert a.y.x.q.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: D = None
        self.v: A = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: E = None
        self.q: B = None
        self.x: A = None
        self.w: A = None
        self.txt = txt

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

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

b = A("b")
j = B("j")
i = C("i")
n = D("n")
a = E("a")
k = A("k")

b.y = n
b.t = n
b.v = k
b.z = i
j.q = n
i.z = k
i.y = a
i.q = j
i.x = b
i.w = b
n.q = i
n.x = j
n.s = a
n.y = k
a.y = n
k.y = n
k.t = n
k.v = b
k.z = i
assert a.y.x.q.s.y.txt == "n"