class A:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: I = None
        self.s: H = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: A = None
        self.w: H = None
        self.s: I = None
        self.v: H = None
        self.q: B = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: D = None
        self.u: D = None
        self.p: B = None
        self.x: I = None
        self.y: B = None
        self.r: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: B = None
        self.z: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: I = None
        self.q: H = None
        self.s: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: A = None
        self.w: H = None
        self.s: I = None
        self.v: H = None
        self.q: B = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: D = None
        self.u: D = None
        self.p: B = None
        self.x: I = None
        self.y: B = None
        self.r: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: B = None
        self.z: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: I = None
        self.q: H = None
        self.s: G = None
        self.txt = txt

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

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