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

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

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

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

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

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

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

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

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

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

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

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

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