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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: G = None
        self.w: D = None
        self.s: D = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: F = None
        self.u: E = None
        self.t: A = None
        self.x: A = None
        self.txt = txt

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

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

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

b = A("b")
m = B("m")
h = C("h")
f = D("f")
n = E("n")
j = F("j")
c = G("c")
g = G("g")

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: G = None
        self.w: D = None
        self.s: D = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: F = None
        self.u: E = None
        self.t: A = None
        self.x: A = None
        self.txt = txt

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

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

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

b = A("b")
m = B("m")
h = C("h")
f = D("f")
n = E("n")
j = F("j")
c = G("c")
g = G("g")

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