class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: B = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: D = None
        self.w: D = None
        self.u: A = None
        self.z: A = None
        self.txt = txt

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

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

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

n = A("n")
e = B("e")
j = C("j")
d = D("d")
l = E("l")
b = E("b")
a = B("a")
h = C("h")

n.z = l
n.t = a
n.q = d
e.t = d
e.r = d
e.w = d
e.u = n
e.z = n
j.v = n
d.v = e
d.r = n
d.p = j
d.t = h
l.z = d
l.x = d
b.z = d
b.x = d
a.t = d
a.r = d
a.w = d
a.u = n
a.z = n
h.v = n
assert n.z.z.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: B = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: D = None
        self.w: D = None
        self.u: A = None
        self.z: A = None
        self.txt = txt

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

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

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

n = A("n")
e = B("e")
j = C("j")
d = D("d")
l = E("l")
b = E("b")
a = B("a")
h = C("h")

n.z = l
n.t = a
n.q = d
e.t = d
e.r = d
e.w = d
e.u = n
e.z = n
j.v = n
d.v = e
d.r = n
d.p = j
d.t = h
l.z = d
l.x = d
b.z = d
b.x = d
a.t = d
a.r = d
a.w = d
a.u = n
a.z = n
h.v = n
assert n.z.z.r.q.txt == "d"