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

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

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

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

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: G = None
        self.q: D = None
        self.u: B = None
        self.z: B = None
        self.p: F = None
        self.txt = txt

f = A("f")
l = B("l")
b = C("b")
i = D("i")
a = E("a")
c = F("c")
e = G("e")
d = H("d")
m = I("m")
h = J("h")

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

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

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

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

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: G = None
        self.q: D = None
        self.u: B = None
        self.z: B = None
        self.p: F = None
        self.txt = txt

f = A("f")
l = B("l")
b = C("b")
i = D("i")
a = E("a")
c = F("c")
e = G("e")
d = H("d")
m = I("m")
h = J("h")

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