class A:
    def __init__(self, txt: str):
        self.q: J = None
        self.p: G = None
        self.z: F = None
        self.o: C = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: H = None
        self.o: A = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: J = None
        self.o: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: G = None
        self.v: E = None
        self.o: I = None
        self.x: G = None
        self.y: G = None
        self.w: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: D = None
        self.p: I = None
        self.w: F = None
        self.q: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: H = None
        self.o: A = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: J = None
        self.o: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: G = None
        self.v: E = None
        self.o: I = None
        self.x: G = None
        self.y: G = None
        self.w: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: D = None
        self.p: I = None
        self.w: F = None
        self.q: B = None
        self.txt = txt

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

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