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

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

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

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

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

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

j.v = l
j.r = k
k.y = n
e.u = j
d.o = n
d.z = n
d.y = a
d.q = j
d.v = k
a.s = h
f.u = j
l.u = j
h.s = a
n.o = d
n.z = d
n.y = h
n.q = j
n.v = k
assert f.u.v.u.r.y.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

j.v = l
j.r = k
k.y = n
e.u = j
d.o = n
d.z = n
d.y = a
d.q = j
d.v = k
a.s = h
f.u = j
l.u = j
h.s = a
n.o = d
n.z = d
n.y = h
n.q = j
n.v = k
assert f.u.v.u.r.y.v.y.txt == "n"