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

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

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

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

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

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

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

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

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

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

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

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

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