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

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

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

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

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

g = A("g")
j = B("j")
n = C("n")
a = D("a")
f = E("f")
i = C("i")

g.z = j
j.u = n
j.v = a
j.w = f
n.q = a
n.v = j
n.o = g
a.t = i
f.z = j
f.t = a
f.p = i
f.y = n
i.q = a
i.v = j
i.o = g
assert a.t.q.t.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

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

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

g = A("g")
j = B("j")
n = C("n")
a = D("a")
f = E("f")
i = C("i")

g.z = j
j.u = n
j.v = a
j.w = f
n.q = a
n.v = j
n.o = g
a.t = i
f.z = j
f.t = a
f.p = i
f.y = n
i.q = a
i.v = j
i.o = g
assert a.t.q.t.v.u.txt == "n"