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

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: H = None
        self.o: B = None
        self.v: B = None
        self.p: E = None
        self.u: F = None
        self.w: B = None
        self.r: A = None
        self.y: F = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: J = None
        self.y: D = None
        self.z: G = None
        self.r: G = None
        self.v: J = None
        self.w: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: E = None
        self.o: C = None
        self.r: J = None
        self.p: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: H = None
        self.o: B = None
        self.v: B = None
        self.p: E = None
        self.u: F = None
        self.w: B = None
        self.r: A = None
        self.y: F = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: J = None
        self.y: D = None
        self.z: G = None
        self.r: G = None
        self.v: J = None
        self.w: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: E = None
        self.o: C = None
        self.r: J = None
        self.p: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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