class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.s: H = None
        self.v: B = None
        self.p: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: G = None
        self.u: A = None
        self.o: C = None
        self.w: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: A = None
        self.z: C = None
        self.p: D = None
        self.o: F = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: D = None
        self.txt = txt

a = A("a")
g = B("g")
d = C("d")
f = D("f")
j = E("j")
l = F("l")
m = G("m")
n = H("n")
k = I("k")

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: G = None
        self.u: A = None
        self.o: C = None
        self.w: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: A = None
        self.z: C = None
        self.p: D = None
        self.o: F = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: D = None
        self.txt = txt

a = A("a")
g = B("g")
d = C("d")
f = D("f")
j = E("j")
l = F("l")
m = G("m")
n = H("n")
k = I("k")

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