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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: G = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: A = None
        self.u: C = None
        self.w: D = None
        self.o: G = None
        self.x: G = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: D = None
        self.t: B = None
        self.o: E = None
        self.p: D = None
        self.u: A = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: E = None
        self.y: E = None
        self.s: D = None
        self.v: F = None
        self.q: D = None
        self.p: E = None
        self.txt = txt

d = A("d")
n = B("n")
m = C("m")
g = D("g")
l = E("l")
c = F("c")
k = G("k")

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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: G = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: A = None
        self.u: C = None
        self.w: D = None
        self.o: G = None
        self.x: G = None
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: D = None
        self.t: B = None
        self.o: E = None
        self.p: D = None
        self.u: A = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: E = None
        self.y: E = None
        self.s: D = None
        self.v: F = None
        self.q: D = None
        self.p: E = None
        self.txt = txt

d = A("d")
n = B("n")
m = C("m")
g = D("g")
l = E("l")
c = F("c")
k = G("k")

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