class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: I = None
        self.x: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: I = None
        self.t: F = None
        self.q: A = None
        self.z: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: I = None
        self.r: C = None
        self.q: C = None
        self.x: G = None
        self.p: H = None
        self.w: A = None
        self.z: E = None
        self.y: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: I = None
        self.x: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: I = None
        self.t: F = None
        self.q: A = None
        self.z: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: I = None
        self.r: C = None
        self.q: C = None
        self.x: G = None
        self.p: H = None
        self.w: A = None
        self.z: E = None
        self.y: G = None
        self.txt = txt

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

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