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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: E = None
        self.w: E = None
        self.o: A = None
        self.y: C = None
        self.x: A = None
        self.q: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: E = None
        self.w: E = None
        self.o: A = None
        self.y: C = None
        self.x: A = None
        self.q: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: E = None
        self.txt = txt

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

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