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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

i.x = f
i.z = e
i.w = b
i.y = n
j.z = b
j.y = b
j.p = a
j.x = n
j.q = k
n.p = j
n.x = j
n.z = i
n.w = e
n.s = b
a.p = b
a.o = k
e.v = i
g.p = b
g.o = a
k.p = b
k.o = a
f.z = b
f.y = b
f.p = a
f.x = n
f.q = g
b.p = j
b.x = j
b.z = i
b.w = e
b.s = n
assert b.p.x.p.z.z.z.v.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: E = None
        self.w: C = None
        self.y: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

i.x = f
i.z = e
i.w = b
i.y = n
j.z = b
j.y = b
j.p = a
j.x = n
j.q = k
n.p = j
n.x = j
n.z = i
n.w = e
n.s = b
a.p = b
a.o = k
e.v = i
g.p = b
g.o = a
k.p = b
k.o = a
f.z = b
f.y = b
f.p = a
f.x = n
f.q = g
b.p = j
b.x = j
b.z = i
b.w = e
b.s = n
assert b.p.x.p.z.z.z.v.w.w.txt == "e"