class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: C = None
        self.x: B = None
        self.o: D = None
        self.txt = txt

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

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

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

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

a = A("a")
l = B("l")
h = C("h")
i = D("i")
n = E("n")
j = C("j")

a.t = l
a.x = l
a.u = j
a.o = i
l.z = n
l.q = n
h.w = i
h.r = i
h.t = a
h.v = a
i.x = l
n.t = i
j.w = i
j.r = i
j.t = a
j.v = a
assert i.x.q.t.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: C = None
        self.x: B = None
        self.o: D = None
        self.txt = txt

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

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

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

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

a = A("a")
l = B("l")
h = C("h")
i = D("i")
n = E("n")
j = C("j")

a.t = l
a.x = l
a.u = j
a.o = i
l.z = n
l.q = n
h.w = i
h.r = i
h.t = a
h.v = a
i.x = l
n.t = i
j.w = i
j.r = i
j.t = a
j.v = a
assert i.x.q.t.x.z.txt == "n"