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

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

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

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

e = A("e")
n = B("n")
k = C("k")
c = D("c")
b = C("b")
d = C("d")
m = D("m")
j = D("j")

e.p = n
n.o = k
n.z = j
n.q = m
k.t = b
k.o = d
k.x = n
c.v = e
c.z = k
c.x = k
b.t = d
b.o = d
b.x = n
d.t = b
d.o = b
d.x = n
m.v = e
m.z = k
m.x = d
j.v = e
j.z = b
j.x = b
assert e.p.z.x.t.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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

e = A("e")
n = B("n")
k = C("k")
c = D("c")
b = C("b")
d = C("d")
m = D("m")
j = D("j")

e.p = n
n.o = k
n.z = j
n.q = m
k.t = b
k.o = d
k.x = n
c.v = e
c.z = k
c.x = k
b.t = d
b.o = d
b.x = n
d.t = b
d.o = b
d.x = n
m.v = e
m.z = k
m.x = d
j.v = e
j.z = b
j.x = b
assert e.p.z.x.t.x.o.txt == "k"