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

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

class C:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: C = None
        self.x: E = None
        self.q: D = None
        self.txt = txt

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

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

l = A("l")
k = B("k")
a = C("a")
d = D("d")
n = E("n")
i = C("i")
m = B("m")
j = B("j")
g = A("g")

l.u = d
l.s = d
l.v = a
l.z = n
k.z = i
k.q = d
k.y = d
k.r = m
k.p = m
a.y = i
a.s = i
a.x = n
a.q = d
d.x = j
n.w = j
n.u = j
n.s = k
n.z = k
i.y = a
i.s = a
i.x = n
i.q = d
m.z = a
m.q = d
m.y = d
m.r = k
m.p = k
j.z = i
j.q = d
j.y = d
j.r = k
j.p = m
g.u = d
g.s = d
g.v = i
g.z = n
assert d.x.z.q.x.q.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: C = None
        self.z: E = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: C = None
        self.x: E = None
        self.q: D = None
        self.txt = txt

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

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

l = A("l")
k = B("k")
a = C("a")
d = D("d")
n = E("n")
i = C("i")
m = B("m")
j = B("j")
g = A("g")

l.u = d
l.s = d
l.v = a
l.z = n
k.z = i
k.q = d
k.y = d
k.r = m
k.p = m
a.y = i
a.s = i
a.x = n
a.q = d
d.x = j
n.w = j
n.u = j
n.s = k
n.z = k
i.y = a
i.s = a
i.x = n
i.q = d
m.z = a
m.q = d
m.y = d
m.r = k
m.p = k
j.z = i
j.q = d
j.y = d
j.r = k
j.p = m
g.u = d
g.s = d
g.v = i
g.z = n
assert d.x.z.q.x.q.x.r.txt == "k"