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

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: J = None
        self.x: I = None
        self.o: B = None
        self.w: H = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: J = None
        self.u: C = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: C = None
        self.r: A = None
        self.y: C = None
        self.z: H = None
        self.v: A = None
        self.q: D = None
        self.x: G = None
        self.u: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: J = None
        self.x: I = None
        self.o: B = None
        self.w: H = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: J = None
        self.u: C = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: C = None
        self.r: A = None
        self.y: C = None
        self.z: H = None
        self.v: A = None
        self.q: D = None
        self.x: G = None
        self.u: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

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

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