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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: E = None
        self.p: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: E = None
        self.v: D = None
        self.u: H = None
        self.s: G = None
        self.p: D = None
        self.q: E = None
        self.w: B = None
        self.x: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: I = None
        self.q: I = None
        self.x: D = None
        self.p: C = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

f = A("f")
j = B("j")
g = C("g")
i = D("i")
e = E("e")
l = F("l")
h = G("h")
n = H("n")
a = I("a")
m = J("m")

f.u = g
f.p = e
j.o = i
j.y = e
j.p = a
g.o = h
g.s = h
g.z = e
g.q = e
g.v = i
g.p = i
g.u = n
g.w = j
g.x = a
i.r = j
i.x = h
i.s = f
e.v = l
e.o = a
e.q = a
e.x = i
e.p = g
e.r = j
l.p = a
l.v = a
l.t = a
l.q = m
l.s = i
l.x = g
l.u = e
h.y = f
h.p = m
h.w = e
n.x = a
n.r = i
n.w = h
a.z = l
a.v = f
a.t = g
a.w = h
a.q = j
a.s = n
m.z = j
m.s = e
m.q = e
assert h.w.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: E = None
        self.p: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: E = None
        self.v: D = None
        self.u: H = None
        self.s: G = None
        self.p: D = None
        self.q: E = None
        self.w: B = None
        self.x: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: I = None
        self.q: I = None
        self.x: D = None
        self.p: C = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

f = A("f")
j = B("j")
g = C("g")
i = D("i")
e = E("e")
l = F("l")
h = G("h")
n = H("n")
a = I("a")
m = J("m")

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