class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: F = None
        self.o: E = None
        self.t: D = None
        self.s: C = None
        self.y: C = None
        self.x: I = None
        self.u: J = None
        self.v: J = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: H = None
        self.q: G = None
        self.u: F = None
        self.p: I = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.u: E = None
        self.v: C = None
        self.r: F = None
        self.p: E = None
        self.o: G = None
        self.s: F = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: J = None
        self.p: I = None
        self.r: I = None
        self.u: F = None
        self.o: A = None
        self.v: F = None
        self.q: B = None
        self.w: I = None
        self.z: J = None
        self.x: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: D = None
        self.r: D = None
        self.s: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: B = None
        self.r: E = None
        self.x: F = None
        self.v: G = None
        self.txt = txt

f = A("f")
n = B("n")
c = C("c")
m = D("m")
b = E("b")
g = F("g")
k = G("k")
h = H("h")
e = I("e")
d = J("d")

f.q = n
f.z = n
f.p = g
f.o = b
f.t = m
f.s = c
f.y = c
f.x = e
f.u = d
f.v = d
n.y = c
n.t = h
n.q = k
n.u = g
n.p = e
n.z = m
c.v = m
c.y = g
c.t = g
c.u = g
c.q = d
c.o = k
c.x = h
m.q = e
m.u = b
m.p = b
m.v = c
m.r = g
m.s = g
m.o = k
m.x = k
b.s = k
g.s = f
k.t = d
k.z = d
k.p = e
k.r = e
k.w = e
k.x = e
k.u = g
k.v = g
k.o = f
k.q = n
h.v = b
h.t = f
h.r = g
e.w = g
e.p = m
e.r = m
e.s = n
d.u = m
d.w = n
d.r = b
d.x = g
d.v = k
assert m.q.w.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: F = None
        self.o: E = None
        self.t: D = None
        self.s: C = None
        self.y: C = None
        self.x: I = None
        self.u: J = None
        self.v: J = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: H = None
        self.q: G = None
        self.u: F = None
        self.p: I = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.u: E = None
        self.v: C = None
        self.r: F = None
        self.p: E = None
        self.o: G = None
        self.s: F = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: J = None
        self.p: I = None
        self.r: I = None
        self.u: F = None
        self.o: A = None
        self.v: F = None
        self.q: B = None
        self.w: I = None
        self.z: J = None
        self.x: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: D = None
        self.r: D = None
        self.s: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: B = None
        self.r: E = None
        self.x: F = None
        self.v: G = None
        self.txt = txt

f = A("f")
n = B("n")
c = C("c")
m = D("m")
b = E("b")
g = F("g")
k = G("k")
h = H("h")
e = I("e")
d = J("d")

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