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

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

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

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

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

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

l.y = k
n.q = b
n.v = h
n.u = h
c.r = a
c.u = f
h.r = e
h.v = j
h.u = f
k.o = c
k.w = c
k.v = a
k.z = e
k.p = e
e.o = c
e.w = c
e.v = n
e.z = k
e.p = k
a.q = b
a.v = f
a.u = h
f.r = e
f.v = b
f.u = h
b.y = e
j.y = e
assert h.r.w.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

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

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

l.y = k
n.q = b
n.v = h
n.u = h
c.r = a
c.u = f
h.r = e
h.v = j
h.u = f
k.o = c
k.w = c
k.v = a
k.z = e
k.p = e
e.o = c
e.w = c
e.v = n
e.z = k
e.p = k
a.q = b
a.v = f
a.u = h
f.r = e
f.v = b
f.u = h
b.y = e
j.y = e
assert h.r.w.r.u.txt == "h"