class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: H = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: H = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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