class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: D = None
        self.y: H = None
        self.r: J = None
        self.u: G = None
        self.z: H = None
        self.q: H = None
        self.w: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: E = None
        self.t: A = None
        self.z: J = None
        self.q: G = None
        self.u: J = None
        self.o: F = None
        self.x: E = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: B = None
        self.s: G = None
        self.y: I = None
        self.u: A = None
        self.z: D = None
        self.o: H = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: F = None
        self.q: B = None
        self.t: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: G = None
        self.w: A = None
        self.z: A = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: E = None
        self.u: I = None
        self.x: G = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: I = None
        self.z: E = None
        self.v: C = None
        self.q: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: E = None
        self.t: A = None
        self.z: J = None
        self.q: G = None
        self.u: J = None
        self.o: F = None
        self.x: E = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: B = None
        self.s: G = None
        self.y: I = None
        self.u: A = None
        self.z: D = None
        self.o: H = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: F = None
        self.q: B = None
        self.t: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: G = None
        self.w: A = None
        self.z: A = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: E = None
        self.u: I = None
        self.x: G = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: I = None
        self.z: E = None
        self.v: C = None
        self.q: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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