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

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

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: A = None
        self.p: C = None
        self.t: H = None
        self.y: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: B = None
        self.t: E = None
        self.v: A = None
        self.u: E = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: F = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: G = None
        self.x: D = None
        self.w: C = None
        self.y: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: A = None
        self.p: C = None
        self.t: H = None
        self.y: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: B = None
        self.t: E = None
        self.v: A = None
        self.u: E = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: F = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: G = None
        self.x: D = None
        self.w: C = None
        self.y: E = None
        self.txt = txt

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

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