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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: A = None
        self.v: E = None
        self.u: D = None
        self.txt = txt

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

h = A("h")
d = B("d")
f = C("f")
n = D("n")
a = E("a")
j = F("j")
k = G("k")
c = B("c")
e = G("e")

h.w = f
h.x = f
h.s = k
h.q = k
d.u = k
d.x = c
d.z = j
f.w = a
f.r = h
f.p = j
f.v = j
f.z = n
n.s = c
n.q = c
n.x = d
n.o = d
n.u = h
n.r = a
a.w = n
a.u = e
a.x = f
a.v = k
a.p = j
j.y = a
j.v = a
j.p = h
j.u = n
k.o = c
k.s = n
k.v = h
c.u = k
c.x = d
c.z = j
e.o = c
e.s = n
e.v = h
assert n.u.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: G = None
        self.x: C = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: A = None
        self.v: E = None
        self.u: D = None
        self.txt = txt

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

h = A("h")
d = B("d")
f = C("f")
n = D("n")
a = E("a")
j = F("j")
k = G("k")
c = B("c")
e = G("e")

h.w = f
h.x = f
h.s = k
h.q = k
d.u = k
d.x = c
d.z = j
f.w = a
f.r = h
f.p = j
f.v = j
f.z = n
n.s = c
n.q = c
n.x = d
n.o = d
n.u = h
n.r = a
a.w = n
a.u = e
a.x = f
a.v = k
a.p = j
j.y = a
j.v = a
j.p = h
j.u = n
k.o = c
k.s = n
k.v = h
c.u = k
c.x = d
c.z = j
e.o = c
e.s = n
e.v = h
assert n.u.x.z.txt == "n"