class A:
    def __init__(self, txt: str):
        self.q: J = None
        self.u: E = None
        self.w: H = None
        self.y: I = None
        self.z: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: G = None
        self.s: I = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: J = None
        self.z: C = None
        self.v: C = None
        self.t: B = None
        self.o: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: J = None
        self.x: C = None
        self.r: C = None
        self.v: I = None
        self.t: D = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.p: E = None
        self.s: F = None
        self.v: C = None
        self.t: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: J = None
        self.q: C = None
        self.v: J = None
        self.x: I = None
        self.y: G = None
        self.u: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: A = None
        self.w: H = None
        self.s: E = None
        self.u: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: G = None
        self.s: I = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: J = None
        self.z: C = None
        self.v: C = None
        self.t: B = None
        self.o: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: J = None
        self.x: C = None
        self.r: C = None
        self.v: I = None
        self.t: D = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.p: E = None
        self.s: F = None
        self.v: C = None
        self.t: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: J = None
        self.q: C = None
        self.v: J = None
        self.x: I = None
        self.y: G = None
        self.u: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: A = None
        self.w: H = None
        self.s: E = None
        self.u: B = None
        self.txt = txt

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

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