class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: D = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: D = None
        self.s: E = None
        self.z: G = None
        self.t: C = None
        self.q: C = None
        self.p: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: F = None
        self.v: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: D = None
        self.s: E = None
        self.z: G = None
        self.t: C = None
        self.q: C = None
        self.p: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: F = None
        self.v: F = None
        self.txt = txt

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

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