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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: A = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: D = None
        self.x: G = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: A = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: D = None
        self.x: G = None
        self.t: C = None
        self.txt = txt

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

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

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