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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: D = None
        self.z: B = None
        self.x: F = None
        self.q: A = None
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: F = None
        self.t: B = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: B = None
        self.r: D = None
        self.z: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: D = None
        self.z: B = None
        self.x: F = None
        self.q: A = None
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: F = None
        self.t: B = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: B = None
        self.r: D = None
        self.z: E = None
        self.txt = txt

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

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