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

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

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

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

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

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

d.p = f
d.y = i
e.p = j
e.v = a
e.w = i
j.w = e
n.u = d
n.t = j
f.z = e
f.v = e
f.w = j
f.x = j
i.u = c
i.t = j
c.p = f
c.y = i
a.u = k
a.t = j
k.p = f
k.y = n
assert d.p.x.w.p.w.w.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

d.p = f
d.y = i
e.p = j
e.v = a
e.w = i
j.w = e
n.u = d
n.t = j
f.z = e
f.v = e
f.w = j
f.x = j
i.u = c
i.t = j
c.p = f
c.y = i
a.u = k
a.t = j
k.p = f
k.y = n
assert d.p.x.w.p.w.w.t.w.txt == "e"