class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: E = None
        self.y: C = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.y: E = None
        self.v: D = None
        self.w: C = None
        self.txt = txt

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

n = A("n")
j = B("j")
g = C("g")
f = D("f")
l = E("l")
k = D("k")

n.t = g
n.y = g
n.v = l
n.w = j
j.z = g
g.z = j
g.q = j
g.x = k
g.p = f
f.r = g
f.z = g
f.w = g
f.y = l
f.v = k
l.y = n
l.t = n
l.u = j
l.o = j
k.r = g
k.z = g
k.w = g
k.y = l
k.v = f
assert k.z.x.y.u.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: E = None
        self.y: C = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.y: E = None
        self.v: D = None
        self.w: C = None
        self.txt = txt

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

n = A("n")
j = B("j")
g = C("g")
f = D("f")
l = E("l")
k = D("k")

n.t = g
n.y = g
n.v = l
n.w = j
j.z = g
g.z = j
g.q = j
g.x = k
g.p = f
f.r = g
f.z = g
f.w = g
f.y = l
f.v = k
l.y = n
l.t = n
l.u = j
l.o = j
k.r = g
k.z = g
k.w = g
k.y = l
k.v = f
assert k.z.x.y.u.z.z.txt == "j"