class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: G = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: F = None
        self.z: A = None
        self.w: G = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: E = None
        self.q: G = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.z: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: E = None
        self.z: E = None
        self.q: E = None
        self.r: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: G = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: F = None
        self.z: A = None
        self.w: G = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: E = None
        self.q: G = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: B = None
        self.z: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: E = None
        self.z: E = None
        self.q: E = None
        self.r: C = None
        self.txt = txt

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

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