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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: F = None
        self.t: J = None
        self.v: F = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: G = None
        self.o: I = None
        self.u: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: I = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: E = None
        self.v: E = None
        self.o: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: F = None
        self.t: J = None
        self.v: F = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: G = None
        self.o: I = None
        self.u: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: I = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: E = None
        self.v: E = None
        self.o: H = None
        self.txt = txt

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

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