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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: E = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: A = None
        self.v: A = None
        self.t: C = None
        self.s: F = None
        self.r: E = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: G = None
        self.p: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: C = None
        self.w: E = None
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: A = None
        self.x: A = None
        self.v: F = None
        self.q: C = None
        self.p: G = None
        self.txt = txt

l = A("l")
d = B("d")
f = C("f")
i = D("i")
j = E("j")
m = F("m")
h = G("h")
n = H("n")
g = C("g")

l.r = i
d.t = h
d.u = j
d.o = l
f.z = j
f.r = j
f.q = j
f.p = l
f.v = l
f.t = g
f.s = m
i.q = f
i.v = h
i.p = g
j.u = m
m.s = n
h.r = m
h.u = m
h.o = f
h.w = j
n.r = f
n.w = l
n.x = l
n.v = m
n.q = g
n.p = h
g.z = j
g.r = j
g.q = j
g.p = l
g.v = l
g.t = f
g.s = m
assert l.r.v.u.s.v.s.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: E = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: A = None
        self.v: A = None
        self.t: C = None
        self.s: F = None
        self.r: E = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: G = None
        self.p: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: C = None
        self.w: E = None
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: A = None
        self.x: A = None
        self.v: F = None
        self.q: C = None
        self.p: G = None
        self.txt = txt

l = A("l")
d = B("d")
f = C("f")
i = D("i")
j = E("j")
m = F("m")
h = G("h")
n = H("n")
g = C("g")

l.r = i
d.t = h
d.u = j
d.o = l
f.z = j
f.r = j
f.q = j
f.p = l
f.v = l
f.t = g
f.s = m
i.q = f
i.v = h
i.p = g
j.u = m
m.s = n
h.r = m
h.u = m
h.o = f
h.w = j
n.r = f
n.w = l
n.x = l
n.v = m
n.q = g
n.p = h
g.z = j
g.r = j
g.q = j
g.p = l
g.v = l
g.t = f
g.s = m
assert l.r.v.u.s.v.s.q.z.txt == "j"