class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: E = None
        self.w: B = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: G = None
        self.p: E = None
        self.w: E = None
        self.t: H = None
        self.v: F = None
        self.r: A = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: C = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: E = None
        self.u: H = None
        self.o: A = None
        self.t: A = None
        self.q: G = None
        self.w: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

l = A("l")
b = B("b")
f = C("f")
g = D("g")
m = E("m")
e = F("e")
h = G("h")
n = H("n")
d = C("d")
k = B("k")

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: G = None
        self.p: E = None
        self.w: E = None
        self.t: H = None
        self.v: F = None
        self.r: A = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: C = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: E = None
        self.u: H = None
        self.o: A = None
        self.t: A = None
        self.q: G = None
        self.w: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

l = A("l")
b = B("b")
f = C("f")
g = D("g")
m = E("m")
e = F("e")
h = G("h")
n = H("n")
d = C("d")
k = B("k")

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